Page principale | Liste des namespaces | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Membres des namespaces | Composants | Déclarations

# ExMath.h

Aller à la documentation de ce fichier.

    00001 /*
    00002  * ExNihilo 3D Engine
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  *
    00018  * Please read AUTHORS file !!!
    00019  *
    00020  * $Id: ExMath.h,v 1.7 2002/08/14 15:32:32 data Exp $
    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__