00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __CMATRIX33_H__
00013 #define __CMATRIX33_H__
00014
00015
00016
00017
00018 #include <Definitions.h>
00019 #include "TVector3.h"
00020
00021
00022
00023
00024
00025
00026
00027
00028 #pragma pack(push, 1) //Ensures that the floats are tightly packed
00029 class CMatrix33
00030 {
00031
00032
00033
00034 public:
00035 CMatrix33() {};
00036 CMatrix33(const float &f);
00037 CMatrix33(const float &f11, const float &f12, const float &f13,
00038 const float &f21, const float &f22, const float &f23,
00039 const float &f31, const float &f32, const float &f33);
00040 CMatrix33(const CMatrix33 &other);
00041
00042 const CMatrix33 &operator=(const CMatrix33 &other);
00043 const CMatrix33 operator*(const CMatrix33 &other) const;
00044 const CMatrix33 &operator*=(const CMatrix33 &other);
00045
00046
00047 const CVector3f CMatrix33::operator*(const CVector3f &v) const;
00048
00049 bool operator==(const CMatrix33 &other) const;
00050 bool operator!=(const CMatrix33 &other) const;
00051
00052
00053 void Set(const float &f);
00054 void Set(const float &f11, const float &f12, const float &f13,
00055 const float &f21, const float &f22, const float &f23,
00056 const float &f31, const float &f32, const float &f33);
00057
00058 void Identity();
00059 bool Inverse();
00060 bool InverseFrom(const CMatrix33 &m);
00061 void Transpose();
00062 void TransposeFrom(const CMatrix33 &m);
00063
00064
00065
00066 void Multiply(const CMatrix33 &first, const CMatrix33 &second);
00067
00068 void Scaling(const float &fX, const float &fY, const float &fZ);
00069 void Scaling(const CVector3f &vScale);
00070 void RotationX(const float &fRad);
00071 void RotationY(const float &fRad);
00072 void RotationZ(const float &fRad);
00073 void RotationZXY(const float &fX, const float &fY, const float &fZ);
00074 void RotationZXY(const CVector3f &vRotation);
00075 const CVector3f GetZXYRotationVector();
00076
00077 void Log(word wTargetLog) const;
00078
00079
00080
00081
00082 protected:
00083
00084
00085
00086
00087 private:
00088
00089
00090
00091
00092 public:
00093
00094
00095 struct
00096 {
00097 float _11, _21, _31;
00098 float _12, _22, _32;
00099 float _13, _23, _33;
00100 };
00101 };
00102 #pragma pack(pop)
00103
00104 #endif