Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DMatrix3n Class Reference

The U4DMatrix3n is in charge of implementing linear algebra matrix operations such as addition, subtraction, transformations, etc. More...

Public Member Functions

 U4DMatrix3n ()
 Constructor which creates a 3x3 default matrix. That is, it creates a 3x3 matrix.
 
 U4DMatrix3n (float m0, float m3, float m6, float m1, float m4, float m7, float m2, float m5, float m8)
 Constructor which creates a 3x3 matrix with the given values.
 
U4DMatrix3noperator= (const U4DMatrix3n &value)
 Creates a copy of the 3x3 matrix. More...
 
 ~U4DMatrix3n ()
 default 3x3 destructor
 
U4DVector3n operator* (const U4DVector3n &v) const
 Method which transforms the given vector by the matrix. More...
 
U4DVector3n transform (const U4DVector3n &v) const
 Method which transforms the given vector by the matrix. More...
 
U4DMatrix3n operator* (const U4DMatrix3n &m) const
 Method which multiplies two 3x3 matrices. More...
 
void operator*= (const U4DMatrix3n &m)
 Method which multiplies two 3x3 matrices. More...
 
void setIdentity ()
 Method which sets a 3x3 matrix to an identity 3x3 matrix.
 
void transformMatrixAboutXAxis (float uAngle)
 Method which transforms a matrix about the x-axis. More...
 
void transformMatrixAboutYAxis (float uAngle)
 Method which transforms a matrix about the y-axis. More...
 
void transformMatrixAboutZAxis (float uAngle)
 Method which transforms a matrix about the z-axis. More...
 
void setInverse (const U4DMatrix3n &m)
 Method which sets current matrix with the inverse of the given matrix. More...
 
U4DMatrix3n inverse () const
 Method which computes the inverse of the matrix. More...
 
void invert ()
 Method which sets the matrix to its inverse.
 
float getDeterminant () const
 Method which computes the determinant of the 3x3 matrix. More...
 
void invertAndTranspose ()
 Method that computes the inverse and transpose of the matrix.
 
void setTranspose (const U4DMatrix3n &m)
 Method that sets the current matrix to a transpose matrix. More...
 
U4DMatrix3n transpose () const
 Method which returns the transpose of the matrix. More...
 
U4DVector3n getFirstRowVector ()
 Method to get the first row of the 3x3 matrix. More...
 
U4DVector3n getSecondRowVector ()
 Method to get the second row of the 3x3 matrix. More...
 
U4DVector3n getThirdRowVector ()
 Method to get the third row of the 3x3 matrix. More...
 
U4DVector3n getFirstColumnVector ()
 Method to get the first column of the 3x3 matrix. More...
 
U4DVector3n getSecondColumnVector ()
 Method to get the second column of the 3x3 matrix. More...
 
U4DVector3n getThirdColumnVector ()
 Method to get the third column of the 3x3 matrix. More...
 
void show ()
 Method which prints the 3x3 matrix components in the window console log.
 

Public Attributes

float matrixData [9] ={0}
 component values of the 3x3 matrix
 

Detailed Description

The U4DMatrix3n is in charge of implementing linear algebra matrix operations such as addition, subtraction, transformations, etc.

Member Function Documentation

◆ getDeterminant()

float U4DEngine::U4DMatrix3n::getDeterminant ( ) const

Method which computes the determinant of the 3x3 matrix.

Returns
Returns the determinant of the matrix

◆ getFirstColumnVector()

U4DVector3n U4DEngine::U4DMatrix3n::getFirstColumnVector ( )

Method to get the first column of the 3x3 matrix.

Returns
Returns the first column of the 3x3 matrix

◆ getFirstRowVector()

U4DVector3n U4DEngine::U4DMatrix3n::getFirstRowVector ( )

Method to get the first row of the 3x3 matrix.

Returns
Returns the first row of the 3x3 matrix

◆ getSecondColumnVector()

U4DVector3n U4DEngine::U4DMatrix3n::getSecondColumnVector ( )

Method to get the second column of the 3x3 matrix.

Returns
Returns the second column of the 3x3 matrix

◆ getSecondRowVector()

U4DVector3n U4DEngine::U4DMatrix3n::getSecondRowVector ( )

Method to get the second row of the 3x3 matrix.

Returns
Returns the second row of the 3x3 matrix

◆ getThirdColumnVector()

U4DVector3n U4DEngine::U4DMatrix3n::getThirdColumnVector ( )

Method to get the third column of the 3x3 matrix.

Returns
Returns the third column of the 3x3 matrix

◆ getThirdRowVector()

U4DVector3n U4DEngine::U4DMatrix3n::getThirdRowVector ( )

Method to get the third row of the 3x3 matrix.

Returns
Returns the third row of the 3x3 matrix

◆ inverse()

U4DMatrix3n U4DEngine::U4DMatrix3n::inverse ( ) const

Method which computes the inverse of the matrix.

Returns
Returns the inverse of the matrix

◆ operator*() [1/2]

U4DMatrix3n U4DEngine::U4DMatrix3n::operator* ( const U4DMatrix3n m) const

Method which multiplies two 3x3 matrices.

Parameters
mMatrix to multiply with
Returns
Returns the multiplication product between the two 3x3 matrices

◆ operator*() [2/2]

U4DVector3n U4DEngine::U4DMatrix3n::operator* ( const U4DVector3n v) const

Method which transforms the given vector by the matrix.

Parameters
v3D vector to transform
Returns
Returns the transformation of the vector

◆ operator*=()

void U4DEngine::U4DMatrix3n::operator*= ( const U4DMatrix3n m)

Method which multiplies two 3x3 matrices.

Parameters
mMatrix to multiply with
Returns
Returns the multiplication product between the two 3x3 matrices

◆ operator=()

U4DMatrix3n & U4DEngine::U4DMatrix3n::operator= ( const U4DMatrix3n value)

Creates a copy of the 3x3 matrix.

Parameters
value3x3 matrix to copy
Returns
Returns a copy of the 3x3 matrix

◆ setInverse()

void U4DEngine::U4DMatrix3n::setInverse ( const U4DMatrix3n m)

Method which sets current matrix with the inverse of the given matrix.

Parameters
m3x3 matrix to use as the inverse

◆ setTranspose()

void U4DEngine::U4DMatrix3n::setTranspose ( const U4DMatrix3n m)

Method that sets the current matrix to a transpose matrix.

Parameters
m3x3 Matrix to use as the transpose

◆ transform()

U4DVector3n U4DEngine::U4DMatrix3n::transform ( const U4DVector3n v) const

Method which transforms the given vector by the matrix.

Parameters
v3D vector to transform
Returns
Returns the transformation of the vector

◆ transformMatrixAboutXAxis()

void U4DEngine::U4DMatrix3n::transformMatrixAboutXAxis ( float  uAngle)

Method which transforms a matrix about the x-axis.

Parameters
uAngleAngle to apply the rotation by

◆ transformMatrixAboutYAxis()

void U4DEngine::U4DMatrix3n::transformMatrixAboutYAxis ( float  uAngle)

Method which transforms a matrix about the y-axis.

Parameters
uAngleAngle to apply the rotation by

◆ transformMatrixAboutZAxis()

void U4DEngine::U4DMatrix3n::transformMatrixAboutZAxis ( float  uAngle)

Method which transforms a matrix about the z-axis.

Parameters
uAngleAngle to apply the rotation by

◆ transpose()

U4DMatrix3n U4DEngine::U4DMatrix3n::transpose ( ) const

Method which returns the transpose of the matrix.

Returns
Returns the transpose of the matrix