NGL
6.5
The NCCA Graphics Library

Matrix Class to do simple matrix operations included operator overloaded functions for maths and matrix * vector type maths. More...
#include <Mat4.h>
Public Member Functions  
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...  
Public Attributes  
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...  
}  
}  
};  
Friends  
class  Vec4 
class  Transformation 
class  Quaternion 
class  Camera 
Matrix Class to do simple matrix operations included operator overloaded functions for maths and matrix * vector type maths.

noexcept 

noexcept 

noexcept 

noexcept 

noexcept 

noexcept 
convert this matrix to a Quaternion
Definition at line 563 of file Mat4.cpp.
References m_openGL, NGL_ASSERT, and Quaternion.

noexcept 
axis / angle rotation using the Euler method
[in]  _angle  the angle in degree to rotate 
[in]  _x  part of the axis should be normalised before call 
[in]  _y  part of the axis should be normalised before call 
[in]  _z  part of the axis should be normalised before call 
Definition at line 512 of file Mat4.cpp.
References m_m, ngl::Vec3::m_x, ngl::Vec3::m_y, ngl::Vec3::m_z, ngl::Vec3::normalize(), and ngl::radians().

noexcept 

noexcept 

noexcept 

noexcept 

noexcept 

noexcept 

noexcept 

noexcept 
get the inverse of the matrix
Definition at line 684 of file Mat4.cpp.
References determinant(), m_00, m_01, m_02, m_03, m_10, m_11, m_12, m_13, m_20, m_21, m_22, m_23, m_30, m_31, m_32, and m_33.

noexcept 

inlinenoexcept 
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
[in]  _deg  the value to be rotated by in degrees 
Definition at line 406 of file Mat4.cpp.
References m_11, m_12, m_21, m_22, and ngl::radians().
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
[in]  _deg  the value to be rotated by in degrees 
Definition at line 418 of file Mat4.cpp.
References m_00, m_02, m_20, m_22, and ngl::radians().
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
[in]  _deg  the value to be rotated by in degrees 
Definition at line 430 of file Mat4.cpp.
References m_00, m_01, m_10, m_11, and ngl::radians().

noexcept 

friend 

friend 
union { ... } 
Real ngl::Mat4::m_00 
Real ngl::Mat4::m_01 
Real ngl::Mat4::m_02 
Real ngl::Mat4::m_03 
Real ngl::Mat4::m_10 
Real ngl::Mat4::m_11 
Real ngl::Mat4::m_12 
Real ngl::Mat4::m_13 
Real ngl::Mat4::m_20 
Real ngl::Mat4::m_21 
Real ngl::Mat4::m_22 
Real ngl::Mat4::m_23 
Real ngl::Mat4::m_30 
Real ngl::Mat4::m_31 
Real ngl::Mat4::m_32 
Real ngl::Mat4::m_33 
Real ngl::Mat4::m_m[4][4] 
std::array<Real,16> ngl::Mat4::m_openGL 