deMath.h

Go to the documentation of this file.
00001 /* Copyright (c) 2005 Arachi, Inc. and Stanford University.
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining
00004  * a copy of this software and associated documentation files (the
00005  * "Software"), to deal in the Software without restriction, including
00006  * without limitation the rights to use, copy, modify, merge, publish,
00007  * distribute, sublicense, and/or sell copies of the Software, and to
00008  * permit persons to whom the Software is furnished to do so, subject
00009  * to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included
00012  * in all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00018  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00019  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00020  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00021  */
00022 
00023 #ifndef _deMath_h
00024 #define _deMath_h
00025 
00026 #include "deTypes.h"
00027 
00028 #include <math.h>
00029 
00034 //      @{
00035 #define deSqrt(x)               ((deFloat)sqrt(x))
00036 #define deCos(x)                ((deFloat)cos(x))
00037 #define deSin(x)                ((deFloat)sin(x))
00038 #define deAcos(x)               ((deFloat)acos(x))
00039 #define deAsin(x)               ((deFloat)asin(x))
00040 #define deAtan2(x,y)    ((deFloat)atan2(x,y))
00041 #define deFabs(x)               ((deFloat)fabs(x))
00042 //      @}
00043 
00048 //      @{
00049 #ifndef M_PI
00050 #define DE_M_PI                 ((deFloat)3.14159265358979323846)  // pi
00051 #else
00052 #define DE_M_PI                 ((deFloat)M_PI)
00053 #endif
00054 #ifndef M_PI_2
00055 #define DE_M_PI_2               ((deFloat)1.57079632679489661923)  // pi/2
00056 #else
00057 #define DE_M_PI_2               ((deFloat)M_PI_2)
00058 #endif
00059 #define DE_QUATERNION_EPSILON                   ((deFloat)0.000001)
00060 #define DE_QUATERNION_COS_THRESHHOLD    (1 - DE_QUATERNION_EPSILON)
00061 //      @}
00062 
00067 //      @{
00068 #ifdef WIN32
00069 #define DE_MATH_API             __inline
00070 #else
00071 #define DE_MATH_API             inline
00072 #endif
00073 //      @}
00074 
00079 //      @{
00080 
00081 #ifdef DE_PS2_VU
00082 #define DE_VECTOR3_SIZE         4
00083 #define DE_MATRIX3_COL          4
00084 #else
00085 #define DE_VECTOR3_SIZE         3
00086 #define DE_MATRIX3_COL          3
00087 #endif
00088 
00089 #define DE_QUATERNION_SIZE      4
00090 #define DE_MATRIX3_ROW          3
00091 #define DE_MATRIX3_SIZE         (DE_MATRIX3_ROW * DE_MATRIX3_COL)       
00092 #define DE_FRAME_SIZE           (DE_QUATERNION_SIZE + DE_VECTOR3_SIZE)
00093 #define DE_TRANSFORM_SIZE       (DE_MATRIX3_SIZE + DE_VECTOR3_SIZE)
00094 //      @}
00095 
00096 #include "deVector3f.h"
00097 #include "deQuaternionf.h"
00098 #include "deMatrix3f.h"
00099 
00100 #ifdef __cplusplus
00101 
00102 class deVector3;
00103 class deQuaternion;
00104 class deMatrix3;
00105 class deFrame;
00106 class deTransform;
00107 class deVector6;
00108 class deMatrix6;
00109 
00110 #include "deVector3.h"
00111 #include "deQuaternion.h"
00112 #include "deMatrix3.h"
00113 #include "deFrame.h"
00114 #include "deTransform.h"
00115 #include "deVector6.h"
00116 #include "deMatrix6.h"
00117 
00118 #include "deVector3.inl"
00119 #include "deQuaternion.inl"
00120 #include "deMatrix3.inl"
00121 #include "deFrame.inl"
00122 #include "deTransform.inl"
00123 #include "deVector6.inl"
00124 #include "deMatrix6.inl"
00125 
00126 #endif //__cplusplus
00127 
00128 #endif // _deMath_h

Generated on Sun Apr 9 22:12:42 2006 for TAO by  doxygen 1.4.6-NO