b2Angle.h 613 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // Created by jovian on 31/07/17.
  3. //
  4. #ifndef TINYSHOOTER_B2ANGLE_H
  5. #define TINYSHOOTER_B2ANGLE_H
  6. #include <box2d/box2d.h>
  7. /**
  8. * Give angle between u and v
  9. * @param u : First vector
  10. * @param v : Second vector
  11. * @return Float angle in radians
  12. */
  13. float b2Angle(const b2Vec2 &u, const b2Vec2 &v);
  14. /**
  15. * Give angle between u and horizon
  16. * @param u : Vector
  17. * @return Float angle in radians
  18. */
  19. float b2Angle(const b2Vec2 &u);
  20. /**
  21. * Give a direction from an angle.
  22. * @param angle Angle of object in radians.
  23. * @return Unit vector.
  24. */
  25. b2Vec2 b2Dir(const float angle);
  26. #endif //TINYSHOOTER_B2ANGLE_H