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

The U4DMatrix4n class is in charge of implementing a representation of a 4x4 matrix. The class implements matrix operations such as addition, subtraction, transformation, inverse, transponse, etc. More...

Public Member Functions

 U4DMatrix4n ()
 Contructor which constructs a 4x4 identity matrix.
 
 U4DMatrix4n (float m0, float m4, float m8, float m12, float m1, float m5, float m9, float m13, float m2, float m6, float m10, float m14, float m3, float m7, float m11, float m15)
 Contructor which constructs a 4x4 matrix in column major format.
 
U4DMatrix4noperator= (const U4DMatrix4n &value)
 Copy constructor for a 4x4 matrix. More...
 
 ~U4DMatrix4n ()
 Desctructor for the 4x4 matrix.
 
U4DMatrix4n operator* (const U4DMatrix4n &m) const
 Method which multiplies two 4x4 matrices. More...
 
U4DMatrix4n multiply (const U4DMatrix4n &m) const
 Method which multiplies two 4x4 matrices. More...
 
void operator*= (const U4DMatrix4n &m)
 Method which multiplies two 4x4 matrices. More...
 
U4DVector3n operator* (const U4DVector3n &v) const
 Method which transforms a 3D vector by the 4x4 matrix. More...
 
U4DVector3n transform (const U4DVector3n &v) const
 Method which transforms a 3D vector by the 4x4 matrix. More...
 
float getDeterminant () const
 Method which gets the determinant of the 4x4 matrix. More...
 
void setInverse (const U4DMatrix4n &m)
 Method that sets the inverse of a 4x4 matrix. More...
 
U4DMatrix4n inverse () const
 Method that computes the inverse of a 4x4 matrix. More...
 
void invert ()
 Inverts the 4x4 matrix.
 
U4DMatrix3n extract3x3Matrix ()
 Method that returns a 3x3 representation of the 4x4 matrix. More...
 
U4DVector3n extractAffineVector ()
 extracts the affine vector from a 4x4 matrix More...
 
void setTranspose (const U4DMatrix4n &m)
 Method that sets the transpose to a 4x4 matrix. More...
 
U4DMatrix4n transpose () const
 Method that computes the transpose of a 4x4 matrix. More...
 
void show ()
 Method that prints the 4x4 matrix components to the console log window.
 

Public Attributes

float matrixData [16] ={0}
 Data elements of the 4x4 matrix. Note, the data elements are ordered in Column Major format.
 

Detailed Description

The U4DMatrix4n class is in charge of implementing a representation of a 4x4 matrix. The class implements matrix operations such as addition, subtraction, transformation, inverse, transponse, etc.

Member Function Documentation

◆ extract3x3Matrix()

U4DMatrix3n U4DEngine::U4DMatrix4n::extract3x3Matrix ( )

Method that returns a 3x3 representation of the 4x4 matrix.

Returns
Returns the rotational part of the 4x4 matrix

◆ extractAffineVector()

U4DVector3n U4DEngine::U4DMatrix4n::extractAffineVector ( )

extracts the affine vector from a 4x4 matrix

Returns
vector representing the position (x, y and z coordinates)

◆ getDeterminant()

float U4DEngine::U4DMatrix4n::getDeterminant ( ) const

Method which gets the determinant of the 4x4 matrix.

Returns
Returns the determinant of the 4x4 matrix

◆ inverse()

U4DMatrix4n U4DEngine::U4DMatrix4n::inverse ( ) const

Method that computes the inverse of a 4x4 matrix.

Returns
Returns the inverse representation of the 4x4 matrix

◆ multiply()

U4DMatrix4n U4DEngine::U4DMatrix4n::multiply ( const U4DMatrix4n m) const

Method which multiplies two 4x4 matrices.

Parameters
m4x4 matrix to multiply
Returns
Returns the product of two 4x4 matrices

◆ operator*() [1/2]

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

Method which multiplies two 4x4 matrices.

Parameters
m4x4 matrix to multiply
Returns
Returns the product of two 4x4 matrices

◆ operator*() [2/2]

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

Method which transforms a 3D vector by the 4x4 matrix.

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

◆ operator*=()

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

Method which multiplies two 4x4 matrices.

Parameters
m4x4 matrix to multiply
Returns
Returns the product of two 4x4 matrices

◆ operator=()

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

Copy constructor for a 4x4 matrix.

Parameters
value4x4 matrix to copy
Returns
Returns a copy of the 4x4 matrix

◆ setInverse()

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

Method that sets the inverse of a 4x4 matrix.

Parameters
m4x4 matrix to compute its inverse and apply it to the current 4x4 matrix

◆ setTranspose()

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

Method that sets the transpose to a 4x4 matrix.

Parameters
m4x4 matrix to compute its transpose and set it to the current 4x4 matrix

◆ transform()

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

Method which transforms a 3D vector by the 4x4 matrix.

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

◆ transpose()

U4DMatrix4n U4DEngine::U4DMatrix4n::transpose ( ) const

Method that computes the transpose of a 4x4 matrix.

Returns
Returns the transpose representation of a 4x4 matrix