| 1 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 |
/** |
| 3 |
* Contains code for 3x3 matrices. |
| 4 |
* \file IceMatrix3x3.cpp |
| 5 |
* \author Pierre Terdiman |
| 6 |
* \date April, 4, 2000 |
| 7 |
*/ |
| 8 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 9 |
|
| 10 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 11 |
/** |
| 12 |
* 3x3 matrix. |
| 13 |
* DirectX-compliant, ie row-column order, ie m[Row][Col]. |
| 14 |
* Same as: |
| 15 |
* m11 m12 m13 first row. |
| 16 |
* m21 m22 m23 second row. |
| 17 |
* m31 m32 m33 third row. |
| 18 |
* Stored in memory as m11 m12 m13 m21... |
| 19 |
* |
| 20 |
* Multiplication rules: |
| 21 |
* |
| 22 |
* [x'y'z'] = [xyz][M] |
| 23 |
* |
| 24 |
* x' = x*m11 + y*m21 + z*m31 |
| 25 |
* y' = x*m12 + y*m22 + z*m32 |
| 26 |
* z' = x*m13 + y*m23 + z*m33 |
| 27 |
* |
| 28 |
* \class Matrix3x3 |
| 29 |
* \author Pierre Terdiman |
| 30 |
* \version 1.0 |
| 31 |
*/ |
| 32 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 33 |
|
| 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 35 |
// Precompiled Header |
| 36 |
#include "Stdafx.h" |
| 37 |
|
| 38 |
using namespace IceMaths; |
| 39 |
|
| 40 |
// Cast operator |
| 41 |
Matrix3x3::operator Matrix4x4() const |
| 42 |
{ |
| 43 |
return Matrix4x4( |
| 44 |
m[0][0], m[0][1], m[0][2], 0.0f, |
| 45 |
m[1][0], m[1][1], m[1][2], 0.0f, |
| 46 |
m[2][0], m[2][1], m[2][2], 0.0f, |
| 47 |
0.0f, 0.0f, 0.0f, 1.0f); |
| 48 |
} |