SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
TaoDeMath.h
1 /* Copyright (c) 2005 Arachi, Inc. and Stanford University. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject
9  * to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef _deMath_h
24 #define _deMath_h
25 
26 #include <tao/matrix/TaoDeTypes.h>
27 
28 #include <math.h>
29 
34 // @{
35 #define deSqrt(x) ((deFloat)sqrt(x))
36 #define deCos(x) ((deFloat)cos(x))
37 #define deSin(x) ((deFloat)sin(x))
38 #define deAcos(x) ((deFloat)acos(x))
39 #define deAsin(x) ((deFloat)asin(x))
40 #define deAtan2(x,y) ((deFloat)atan2(x,y))
41 #define deFabs(x) ((deFloat)fabs(x))
42 // @}
43 
48 // @{
49 #ifndef M_PI
50 #define DE_M_PI ((deFloat)3.14159265358979323846) // pi
51 #else
52 #define DE_M_PI ((deFloat)M_PI)
53 #endif
54 #ifndef M_PI_2
55 #define DE_M_PI_2 ((deFloat)1.57079632679489661923) // pi/2
56 #else
57 #define DE_M_PI_2 ((deFloat)M_PI_2)
58 #endif
59 #define DE_QUATERNION_EPSILON ((deFloat)0.000001)
60 #define DE_QUATERNION_COS_THRESHHOLD (1 - DE_QUATERNION_EPSILON)
61 // @}
62 
67 // @{
68 #ifdef WIN32
69 #define DE_MATH_API __inline
70 #else
71 #define DE_MATH_API inline
72 #endif
73 // @}
74 
79 // @{
80 
81 #ifdef DE_PS2_VU
82 #define DE_VECTOR3_SIZE 4
83 #define DE_MATRIX3_COL 4
84 #else
85 #define DE_VECTOR3_SIZE 3
86 #define DE_MATRIX3_COL 3
87 #endif
88 
89 #define DE_QUATERNION_SIZE 4
90 #define DE_MATRIX3_ROW 3
91 #define DE_MATRIX3_SIZE (DE_MATRIX3_ROW * DE_MATRIX3_COL)
92 #define DE_FRAME_SIZE (DE_QUATERNION_SIZE + DE_VECTOR3_SIZE)
93 #define DE_TRANSFORM_SIZE (DE_MATRIX3_SIZE + DE_VECTOR3_SIZE)
94 // @}
95 
96 #include "TaoDeVector3f.h"
97 #include "TaoDeQuaternionf.h"
98 #include "TaoDeMatrix3f.h"
99 
100 #ifdef __cplusplus
101 
102 class deVector3;
103 class deQuaternion;
104 class deMatrix3;
105 class deFrame;
106 class deTransform;
107 class deVector6;
108 class deMatrix6;
109 
110 #include "TaoDeVector3.h"
111 #include "TaoDeQuaternion.h"
112 #include "TaoDeMatrix3.h"
113 #include "TaoDeFrame.h"
114 #include "TaoDeTransform.h"
115 #include "TaoDeVector6.h"
116 #include "TaoDeMatrix6.h"
117 
118 #include "TaoDeVector3Inl.h"
119 #include "TaoDeQuaternionInl.h"
120 #include "TaoDeMatrix3Inl.h"
121 #include "TaoDeFrameInl.h"
122 #include "TaoDeTransformInl.h"
123 #include "TaoDeVector6Inl.h"
124 #include "TaoDeMatrix6Inl.h"
125 
126 #endif //__cplusplus
127 
128 #endif // _deMath_h
3x1 vector classThis is a C++ wrapper class of deVector3f.
Definition: TaoDeVector3.h:32
6x1 vector classThis class consists of two 3x1 vectors.
Definition: TaoDeVector6.h:33
Transformation class using rotational matrixThis class consists of a matrix for rotation and a vector...
Definition: TaoDeTransform.h:32
Quaternion classThis is a C++ wrapper class of deQuaternionf.
Definition: TaoDeQuaternion.h:35
Transformation class using quaternionThis class consists of a quaternion for rotation and a vector fo...
Definition: TaoDeFrame.h:36
6x6 matrix classThis class consists of four 3x3 matrices.
Definition: TaoDeMatrix6.h:33
3x3 matrix classThis is a C++ wrapper class of deMatrix3f.
Definition: TaoDeMatrix3.h:33