00001 #ifndef FLOAT_MATH_H
00002
00003 #define FLOAT_MATH_H
00004
00005 namespace ConvexDecomposition
00006 {
00007
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 const double FM_PI = 3.141592654f;
00083 const double FM_DEG_TO_RAD = ((2.0f * FM_PI) / 360.0f);
00084 const double FM_RAD_TO_DEG = (360.0f / (2.0f * FM_PI));
00085
00086 void fm_identity(double *matrix);
00087 void fm_inverseRT(const double *matrix,const double *pos,double *t);
00088 void fm_transform(const double *matrix,const double *pos,double *t);
00089 void fm_rotate(const double *matrix,const double *pos,double *t);
00090 void fm_eulerMatrix(double ax,double ay,double az,double *matrix);
00091 void fm_getAABB(unsigned int vcount,const double *points,unsigned int pstride,double *bmin,double *bmax);
00092 void fm_eulerToQuat(double roll,double pitch,double yaw,double *quat);
00093 void fm_quatToMatrix(const double *quat,double *matrix);
00094 void fm_quatRotate(const double *quat,const double *v,double *r);
00095 void fm_getTranslation(const double *matrix,double *t);
00096 void fm_matrixToQuat(const double *matrix,double *quat);
00097 double fm_sphereVolume(double radius);
00098 double fm_cylinderVolume(double radius,double h);
00099 double fm_capsuleVolume(double radius,double h);
00100 double fm_distance(const double *p1,const double *p2);
00101 double fm_distanceSquared(const double *p1,const double *p2);
00102 double fm_computePlane(const double *p1,const double *p2,const double *p3,double *n);
00103 double fm_distToPlane(const double *plane,const double *pos);
00104 double fm_dot(const double *p1,const double *p2);
00105 void fm_cross(double *cross,const double *a,const double *b);
00106 void fm_computeNormalVector(double *n,const double *p1,const double *p2);
00107 bool fm_computeWindingOrder(const double *p1,const double *p2,const double *p3);
00108 void fm_normalize(double *n);
00109
00110 };
00111
00112 #endif