MathFuncs.h 969 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _MATHFUNCS_H_
  2. #define _MATHFUNCS_H_
  3. #include "Common.h"
  4. #include "MathForwardDecls.h"
  5. namespace M {
  6. const float PI = 3.14159265358979323846;
  7. const float EPSILON = 1.0e-6;
  8. void mathSanityChecks();
  9. void sinCos( float rad, float& sin_, float& cos_ );
  10. float invSqrt( float f );
  11. float sqrt( float f );
  12. float toRad( float degrees );
  13. float toDegrees( float rad );
  14. float sin( float rad );
  15. float cos( float rad );
  16. bool isZero( float f );
  17. /**
  18. * combineTransformations
  19. * mat4(t0,r0,s0)*mat4(t1,r1,s1) == mat4(tf,rf,sf)
  20. */
  21. void combineTransformations( const Vec3& t0, const Mat3& r0, float s0,
  22. const Vec3& t1, const Mat3& r1, float s1,
  23. Vec3& tf, Mat3& rf, float& sf );
  24. /// combineTransformations as the above but without scale
  25. void combineTransformations( const Vec3& t0, const Mat3& r0, const Vec3& t1, const Mat3& r1, Vec3& tf, Mat3& rf);
  26. } // end namespace
  27. #include "MathFuncs.inl.h"
  28. #endif