00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _matrix4x4_h
00013 #define _matrix4x4_h
00014
00015 template <typename Real> class Vector3;
00016 template <typename Real> class Vector4;
00017
00018 template <typename Real>
00019 class Matrix4x4
00020 {
00021 public:
00022 Matrix4x4();
00023 Matrix4x4(const Real m[4][4]);
00024
00025 void toGLMatrix(float glMatrix[16]) const;
00026 Matrix4x4 inverse() const;
00027
00028 Real &operator()(unsigned int i, unsigned int j);
00029 Real *operator[](unsigned int i) { return m[i]; }
00030 Vector4<Real> operator*(const Vector4<Real>& vec4) const;
00031 Matrix4x4 operator*(const Matrix4x4& m2) const;
00032
00033
00034 static Matrix4x4 scale(Real scale);
00035 static Matrix4x4 scale(Real sx, Real sy, Real sz);
00036
00037 static Matrix4x4 rotationXYZ(Real rx, Real ry, Real rz);
00038 static Matrix4x4 translation(Real tx, Real ty, Real tz);
00039 static Matrix4x4 identity();
00040
00041 protected:
00042 Real m[4][4];
00043
00044 static Matrix4x4 identityMatrix;
00045 };
00046
00047 #include "Matrix4x4_Impl.h"
00048
00049 #endif