00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __EXMATH_H__
00025 #define __EXMATH_H__
00026
00027 #include <math.h>
00028 #include <cmath>
00029 #include "Math/ExCVec3D.h"
00030 #include "Math/ExCVec2D.h"
00031 #include "Math/ExCMatrix4x4.h"
00032 #include "Math/ExCMatrix3x3.h"
00033 #include "Math/ExQuaternion.h"
00034 #include "Math/ExCFrustum.h"
00035 #include "Math/cos.h"
00036 #include "Math/sin.h"
00037
00038
00039 ExCMatrix4x4 MatriceByVec3D(const ExCMatrix4x4 &m,const ExCVec3D &v);
00040 float GetDotProduct(const ExCVec3D& Vec1,const ExCVec3D& Vec2);
00041 ExCVec3D GetCrossProduct(const ExCVec3D& Vec1,const ExCVec3D& Vec2);
00042 ExCVec3D GetVecNormale(const ExCVec3D& Vec1);
00043 ExCMatrix4x4 GetMatrixFromQuaternion(const ExQuaternion& Q);
00044 ExCMatrix4x4 GetMatrixFromEuler(float roll,float pitch,float yaw);
00045 ExQuaternion GetQuaternionFromEuler(float x,float y,float z);
00046 void NormalizePlane(float Plane[6][4], int side);
00047 inline float DegreesToRadians(float deg){return deg * PI/180.0f;}
00048 inline float RadiansToDegrees(float rad){return rad * 180.0f /PI;}
00049
00050 ExCVec3D GetAxisFromQuaternion(const ExQuaternion& Q);
00051
00052 ExCVec3D GetNewVecFromEuler(ExCVec3D force,float roll,float pitch,float yaw);
00053
00054 void ProjectPointOnPlane( ExCVec3D dst, const ExCVec3D p, const ExCVec3D normal );
00055 void PerpendicularVector( ExCVec3D dst, const ExCVec3D src );
00056
00057 float getRandomMinMax( float fMin, float fMax );
00058 ExCVec3D getRandomVector( void );
00059
00060 float DistanceBeteweenTwoPoint(ExCVec3D p1,ExCVec3D p2);
00061 #endif //__EXMATH_H__