28 #ifndef HPL_MATHTYPES_H 29 #define HPL_MATHTYPES_H 31 #include "common/array.h" 32 #include "common/list.h" 33 #include "hpl1/engine/math/Vector2.h" 34 #include "hpl1/engine/math/Vector3.h" 35 #include "hpl1/engine/math/hplMatrix.h" 36 #include "hpl1/engine/system/SystemTypes.h" 40 #define kPif (3.141592654f) 41 #define kPi2f (1.570796327f) 42 #define kPi4f (0.7853981634f) 43 #define k2Pif (6.283185307f) 45 #define kEpsilonf (0.0001f) 47 #define kSqrt2f (1.414213562f) 49 enum eEulerRotationOrder {
50 eEulerRotationOrder_XYZ,
51 eEulerRotationOrder_XZY,
52 eEulerRotationOrder_YXZ,
53 eEulerRotationOrder_YZX,
54 eEulerRotationOrder_ZXY,
55 eEulerRotationOrder_ZYX,
56 eEulerRotationOrder_LastEnum,
63 float max, min, val, up_speed, down_speed;
66 cLinearOscillation(
float afMin,
float afMax,
float afVal,
float afUpSpeed,
float afDownSpeed) {
67 SetUp(afMin, afMax, afVal, afUpSpeed, afDownSpeed);
70 void SetUp(
float afMin,
float afMax,
float afVal,
float afUpSpeed,
float afDownSpeed) {
75 up_speed =
ABS(afUpSpeed);
76 down_speed = -
ABS(afDownSpeed);
81 void Update(
float afTimeStep) {
82 val += add * afTimeStep;
110 cPlane(T aA, T aB, T aC, T aD) {
127 FromNormalPoint(avNormal, avPoint);
134 FromPoints(avPoint0, avPoint1, avPoint2);
145 d = -(avNormal.x * avPoint.x + avNormal.y * avPoint.y + avNormal.z * avPoint.z);
156 normal.x = vEdge1.y * vEdge2.z - vEdge1.z * vEdge2.y;
157 normal.y = vEdge1.z * vEdge2.x - vEdge1.x * vEdge2.z;
158 normal.z = vEdge1.x * vEdge2.y - vEdge1.y * vEdge2.x;
167 d = -(normal.x * avPoint0.x + normal.y * avPoint0.y + normal.z * avPoint0.z);
172 inline void Normalise() {
173 T fMag = sqrt(a * a + b * b + c * c);
182 inline void CalcNormal() {
189 void FromVec(T *apV) {
228 cRect2(T aX, T aY, T aW, T aH) {
253 void FromVec(T *apV) {
297 #include "hpl1/engine/math/Quaternion.h" 299 #endif // HPL_MATHTYPES_H Definition: MathTypes.h:225
cMatrixf * iterator
Definition: array.h:54
Definition: MathTypes.h:103
T Normalise()
Definition: Vector3.h:299
Definition: MathTypes.h:206
Definition: list_intern.h:51
Definition: MathTypes.h:61
T ABS(T x)
Definition: util.h:56