Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MATH_MATRIX3_H
00024 #define MATH_MATRIX3_H
00025
00026 #include "math/rotation3d.h"
00027 #include "math/squarematrix.h"
00028 #include "math/vector3d.h"
00029
00030 namespace Math {
00031
00032 template<>
00033 class Matrix<3, 3> : public MatrixType<3, 3>, public Rotation3D<Matrix<3, 3> > {
00034 public:
00035 Matrix();
00036 Matrix(const MatrixBase<3, 3> &m);
00037
00038 void transpose();
00039
00040
00053 void buildFromTargetDir(const Math::Vector3d &modelForward, const Math::Vector3d &targetDirection,
00054 const Math::Vector3d &modelUp, const Math::Vector3d &worldUp);
00055
00056 inline Matrix<3, 3> operator*(const Matrix<3, 3> &m2) const {
00057 Matrix<3, 3> result;
00058 const float *d1 = getData();
00059 const float *d2 = m2.getData();
00060 float *r = result.getData();
00061
00062 for (int i = 0; i < 9; i += 3) {
00063 for (int j = 0; j < 3; ++j) {
00064 r[i + j] = (d1[i + 0] * d2[j + 0])
00065 + (d1[i + 1] * d2[j + 3])
00066 + (d1[i + 2] * d2[j + 6]);
00067 }
00068 }
00069
00070 return result;
00071 }
00072 };
00073
00074 typedef Matrix<3, 3> Matrix3;
00075
00076 }
00077
00078 #endif
00079