00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __SIM_MATRIX33_H__
00018 #define __SIM_MATRIX33_H__
00019
00020 #include "Vector3.h"
00027 class Matrix33
00028 {
00029 public:
00030 static const Matrix33 ZERO;
00031 static const Matrix33 IDENTITY;
00032
00033 public:
00034 static Matrix33 rotateAboutX (Real a);
00035 static Matrix33 rotateAboutY (Real a);
00036 static Matrix33 rotateAboutZ (Real a);
00037 static Matrix33 rotate (Real a, const Vector3& axis);
00038
00039 public:
00040 Matrix33 ();
00041 Matrix33 (const Matrix33& matrix);
00042 Matrix33 (const Vector3& euler);
00043 Matrix33 (const Vector3& c0, const Vector3& c1, const Vector3& c2);
00044 Matrix33 (const Real matrix[3][3]);
00045 Matrix33 (const Real m00, const Real m01, const Real m02,
00046 const Real m10, const Real m11, const Real m12,
00047 const Real m20, const Real m21, const Real m22);
00048
00049 ~Matrix33 ();
00050
00051 public:
00052 Real* operator [] (const unsigned int i) const;
00053
00054
00055 Matrix33& operator = (const Matrix33& matrix);
00056 Matrix33& operator = (const Real* matrix);
00057
00058 Matrix33 operator + (const Matrix33& matrix) const;
00059 Matrix33 operator - (const Matrix33& matrix) const;
00060 Matrix33 operator * (const Real scalar) const;
00061 Vector3 operator * (const Vector3& vector) const;
00062 Matrix33 operator * (const Matrix33& matrix) const;
00063 void print() const;
00064
00065 friend Matrix33 operator * (const Real scalar, const Matrix33& matrix);
00066 friend Vector3 operator * (const Vector3& vector, const Matrix33& matrix);
00067
00068 public:
00069 Matrix33 transpose ();
00070 Vector3 eulerAngles ();
00071
00072 protected:
00073 Real m[3][3];
00074 };
00075
00076 #endif