Matrix Class to do simple matrix operations included operator overloaded functions for maths and matrix * vector type maths.
More...
|
| Mat4 () noexcept |
| ctor will always create an identity matrix More...
|
|
| Mat4 (Real _m[4][4]) noexcept |
| ctor using 4x4 array, really useful when mixing with Imath as we can do Imath::Matrix44 <float> iMatrix; Mat4 nMatrix(iMatrix.x) More...
|
|
| Mat4 (Real _00, Real _01, Real _02, Real _03, Real _10, Real _11, Real _12, Real _13, Real _20, Real _21, Real _22, Real _23, Real _30, Real _31, Real _32, Real _33) noexcept |
| ctor using individual elements More...
|
|
| Mat4 (const Mat4 &_m) noexcept |
| copy ctor with reference object More...
|
|
| Mat4 (Real _m) noexcept |
| copy ctor with Real useful for Mat4 m=1; for identity or Matrix m=3.5 for uniform scale More...
|
|
Mat4 & | operator= (const Mat4 &_m) noexcept |
| assignment operator More...
|
|
void | setAtXY (GLint _x, GLint _y, Real _equals) noexcept |
| set the value at m_m[_x][_y] to _equals More...
|
|
const Mat4 & | null () noexcept |
| clear the matrix to all 0 More...
|
|
const Mat4 & | identity () noexcept |
| make the matrix m the identity matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
More...
|
|
Mat4 | operator* (const Mat4 &_m) const noexcept |
| operator for matrix multiplication More...
|
|
const Mat4 & | operator*= (const Mat4 &_m) noexcept |
| operator to mult this matrix by value _m More...
|
|
Mat4 | operator+ (const Mat4 &_m) const noexcept |
| operator to add two matrices together More...
|
|
const Mat4 & | operator+= (const Mat4 &_m) noexcept |
| += operator More...
|
|
Mat4 | operator* (const Real _i) const noexcept |
| operator to mult matrix by a scalar More...
|
|
const Mat4 & | operator*= (const Real _i) noexcept |
| *= operator with a scalar value More...
|
|
const Mat4 & | transpose () noexcept |
| method to transpose the matrix More...
|
|
void | rotateX (const Real _deg) noexcept |
| set this matrix to a rotation matrix in the X axis for value _deg note the matrix should be set to identity before doing this More...
|
|
void | rotateY (const Real _deg) noexcept |
| set this matrix to a rotation matrix in the Y axis for value _deg note the matrix should be set to identity before doing this More...
|
|
void | rotateZ (const Real _deg) noexcept |
| set this matrix to a rotation matrix in the Z axis for value _deg note the matrix should be set to identity before doing this More...
|
|
void | scale (const Real _x, const Real _y, const Real _z) noexcept |
| set the matrix scale values More...
|
|
void | translate (const Real _x, const Real _y, const Real _z) noexcept |
| set the matrix as a translation matrix More...
|
|
Real | determinant () const noexcept |
| get the determinant of the matrix More...
|
|
void | subMatrix3x3 (const int _i, const int _j, Real o_mat[]) const noexcept |
| get a sub 3x3 matrix used in determinant and Inverse calculations More...
|
|
void | as3x3Array (Real _d[9]) const noexcept |
| return the data as a 3x3 matrix More...
|
|
Mat4 | inverse () noexcept |
| get the inverse of the matrix More...
|
|
Quaternion | asQuaternion () const noexcept |
| convert this matrix to a Quaternion More...
|
|
Vec4 | operator* (const Vec4 &_v) const noexcept |
| multiply this by a Vec4 More...
|
|
void | euler (const Real _angle, const Real _x, const Real _y, const Real _z) noexcept |
| axis / angle rotation using the Euler method More...
|
|
Real * | openGL () noexcept |
| accesor to the openGL matrix More...
|
|
Mat4 | Adjacent (const Mat4 &_mat) noexcept |
| returns a matrix adjacent to the matrix passed in More...
|
|
Mat4 | Adjacent () noexcept |
| returns the ajacent matrix to this More...
|
|
Vec3 | getLeftVector () const noexcept |
| get the left vector of the matrix (-ve 1st Row) More...
|
|
Vec3 | getRightVector () const noexcept |
| get the right vector of the matrix ( 1nd Row) More...
|
|
Vec3 | getUpVector () const noexcept |
| get the up vector of the matrix (2nd Row) More...
|
|
Vec3 | getDownVector () const noexcept |
| get the down vector of the matrix ( -ve 2nd Row) More...
|
|
Vec3 | getForwardVector () const noexcept |
| get the forward vector of the matrix (-ve 3rd Row) More...
|
|
Vec3 | getBackVector () const noexcept |
| get the back vector of the matrix ( 3nd Row) More...
|
|
|
union { |
Real m_m [4][4] |
| matrix element m_m as a 4x4 array mapped by union to m_nn elements and m_openGL More...
|
|
std::array< Real, 16 > m_openGL |
| The matrix in m_openGL 16 Real array format usefull for OpenGL fv formats mapped to m_m[][] elements and m_xx elements. More...
|
|
struct { |
struct { |
Real m_00 |
| individual matrix element maps to m_m[0][0] or m_openGL[0] More...
|
|
Real m_01 |
| individual matrix element maps to m_m[0][1] or m_openGL[1] More...
|
|
Real m_02 |
| individual matrix element maps to m_m[0][2] or m_openGL[2] More...
|
|
Real m_03 |
| individual matrix element maps to m_m[0][3] or m_openGL[3] More...
|
|
Real m_10 |
| individual matrix element maps to m_m[1][0] or m_openGL[4] More...
|
|
Real m_11 |
| individual matrix element maps to m_m[1][1] or m_openGL[5] More...
|
|
Real m_12 |
| individual matrix element maps to m_m[1][2] or m_openGL[6] More...
|
|
Real m_13 |
| individual matrix element maps to m_m[1][3] or m_openGL[7] More...
|
|
Real m_20 |
| individual matrix element maps to m_m[2][0] or m_openGL[8] More...
|
|
Real m_21 |
| individual matrix element maps to m_m[2][1] or m_openGL[9] More...
|
|
Real m_22 |
| individual matrix element maps to m_m[2][2] or m_openGL[10] More...
|
|
Real m_23 |
| individual matrix element maps to m_m[2][3] or m_openGL[11] More...
|
|
Real m_30 |
| individual matrix element maps to m_m[3][0] or m_openGL[12] More...
|
|
Real m_31 |
| individual matrix element maps to m_m[3][1] or m_openGL[13] More...
|
|
Real m_32 |
| individual matrix element maps to m_m[3][2] or m_openGL[14] More...
|
|
Real m_33 |
| individual matrix element maps to m_m[3][3] or m_openGL[15] More...
|
|
} | |
|
} | |
|
}; | |
|
Matrix Class to do simple matrix operations included operator overloaded functions for maths and matrix * vector type maths.
- Note
- for clarity here is the martix offsets m_openGL[n] and the m_00 / [][] versions I tend to draw this out a lot so thought I would put it here to save me doing it again [y][x] i [y][x] i [y][x] i [y][x] i [ (0,0) 0 m_00 | (0,1) 4 m_10 | (0,2) 8 m_20 | (0,3) 12 m_30] [ (1,0) 1 m_01 | (1,1) 5 m_11 | (1,2) 9 m_21 | (1,3) 13 m_31] [ (2,0) 2 m_02 | (2,1) 6 m_12 | (2,2) 10 m_22 | (2,3) 14 m_32] [ (3,0) 3 m_03 | (3,1) 7 m_13 | (3,2) 11 m_23 | (3,3) 15 m_33] you will note that the m_ values are transposed so be wary
- Author
- Jonathan Macey
- Version
- 3.0
- Date
- Last Revision 28/09/09 Updated to NCCA Coding standard
Definition at line 58 of file Mat4.h.