00001
00002
00003
00004
00005
00006 #ifndef __MATRIX_H_
00007 #define __MATRIX_H_
00008
00009 class Vector3D;
00010 class Point3D;
00011
00013
00014 class Matrix
00015 {
00016 private:
00017
00018 float m[16];
00019
00020 __forceinline void Verify_Matrix();
00021
00022 public:
00023
00024 Matrix();
00025 Matrix(const float m[16]);
00026 Matrix(const Vector3D &v);
00027 Matrix(const float angle, const Vector3D &v);
00028
00029
00030
00032
00033 void Zero_Clamp(void);
00034
00035 void GetValues(float m[16]) const;
00036 void GetTranslation(Point3D &p) const;
00037
00038
00039
00040
00041 void GetEulerAngles(float &x, float &y, float &z) const;
00042
00043 void SetValues(const float m[16]);
00044 void SetValues(const Point3D &p);
00045 void SetValues(const Vector3D &v);
00046 void SetValues(const float angle, const Vector3D &v);
00047
00048 void SetValues_RotX(const float angle);
00049 void SetValues_RotY(const float angle);
00050 void SetValues_RotZ(const float angle);
00051 void SetValues_Rot(const float x, const float y, const float z);
00052
00054
00055
00056
00057
00058 void Inverse(void);
00059
00060 void LoadIdentity(void);
00061
00062 void Negate(void);
00063
00064 void Transpose(void);
00065
00067
00068 Matrix operator*(const Matrix &m) const;
00069 Matrix operator*(const float s) const;
00070
00071
00072 Matrix operator-() const;
00073
00074 Vector3D operator*(const Vector3D &v) const;
00075 Point3D operator*(const Point3D &p) const;
00076
00077 Matrix& operator=(const Matrix &m);
00078
00079
00080 Matrix& operator*=(const Matrix &m);
00081 Matrix& operator*=(const float s);
00082
00083 int operator==(const Matrix &m) const;
00084 int operator!=(const Matrix &m) const;
00085
00086
00087
00088 void Print() const;
00089
00090 };
00091
00093
00094 #endif // __MATRIX_H_