Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::Matrix4x4 Class Reference

4 by 4 matrix in colum mayor order. More...

#include <aeongames/Matrix4x4.hpp>

Collaboration diagram for AeonGames::Matrix4x4:
Collaboration graph

Public Member Functions

DLL Matrix4x4 ()
 Default constructor.
DLL Matrix4x4 (const Transform &aTransform)
 Constructor.
DLL Matrix4x4 (const float *const aMatrix)
 Construct from a float array.
DLL Matrix4x4 (const std::initializer_list< const float > aList)
 Construct from an initializer list.
DLL ~Matrix4x4 ()
 destructor.
DLL const float *const GetMatrix4x4 () const
 Get a pointer to the internal matrix data.
DLL const Matrix4x4 GetInvertedMatrix4x4 ()
 Get the inverted matrix.
DLL Matrix4x4Invert ()
 Invert this matrix in place.
DLL void Frustum (float aLeft, float aRight, float aBottom, float aTop, float aNear, float aFar)
 Set up a perspective projection matrix defined by a frustum.
DLL void Ortho (float aLeft, float aRight, float aBottom, float aTop, float aNear, float aFar)
 Set up an orthographic projection matrix.
DLL void Perspective (float aFieldOfVision, float aAspect, float aNear, float aFar)
 Set up a symmetric perspective projection matrix.
DLL Matrix4x4Rotate (float angle, float x, float y, float z)
 Apply a rotation to this matrix.

Operators

static DLL const Matrix4x4 Identity {}
 The 4x4 identity matrix constant.
float mMatrix [16]
 Lineal row mayor matrix.
DLL Matrix4x4operator*= (const Matrix4x4 &lhs)
 Multiply this matrix by another matrix.
DLL const float operator[] (size_t aIndex) const
 Access a matrix element by index.
static DLL const Matrix4x4 GetRotationMatrix (float angle, float x, float y, float z)
 Constructs the rotation matrix defined by the axis-angle provided.

Detailed Description

4 by 4 matrix in colum mayor order.

Definition at line 34 of file Matrix4x4.hpp.

Constructor & Destructor Documentation

◆ Matrix4x4() [1/4]

AeonGames::Matrix4x4::Matrix4x4 ( )

Default constructor.

Definition at line 27 of file Matrix4x4.cpp.

◆ Matrix4x4() [2/4]

AeonGames::Matrix4x4::Matrix4x4 ( const Transform & aTransform)

Constructor.

Parameters
aTransformTransform from which to initialize the matrix.

Definition at line 32 of file Matrix4x4.cpp.

◆ Matrix4x4() [3/4]

AeonGames::Matrix4x4::Matrix4x4 ( const float *const aMatrix)

Construct from a float array.

Parameters
aMatrixPointer to a float array of at least 16 elements in column-major order.

Definition at line 36 of file Matrix4x4.cpp.

◆ Matrix4x4() [4/4]

AeonGames::Matrix4x4::Matrix4x4 ( const std::initializer_list< const float > aList)

Construct from an initializer list.

Parameters
aListInitializer list of float values for the matrix elements.

Definition at line 41 of file Matrix4x4.cpp.

Member Function Documentation

◆ Frustum()

void AeonGames::Matrix4x4::Frustum ( float aLeft,
float aRight,
float aBottom,
float aTop,
float aNear,
float aFar )

Set up a perspective projection matrix defined by a frustum.

Parameters
aLeftLeft vertical clipping plane.
aRightRight vertical clipping plane.
aBottomBottom horizontal clipping plane.
aTopTop horizontal clipping plane.
aNearNear depth clipping plane distance.
aFarFar depth clipping plane distance.

Definition at line 69 of file Matrix4x4.cpp.

◆ GetInvertedMatrix4x4()

const Matrix4x4 AeonGames::Matrix4x4::GetInvertedMatrix4x4 ( )

Get the inverted matrix.

Returns
A new Matrix4x4 that is the inverse of this matrix.

Definition at line 64 of file Matrix4x4.cpp.

◆ GetMatrix4x4()

const float *const AeonGames::Matrix4x4::GetMatrix4x4 ( ) const

Get a pointer to the internal matrix data.

Returns
Pointer to the 16 float elements of the matrix.

Definition at line 53 of file Matrix4x4.cpp.

◆ GetRotationMatrix()

const Matrix4x4 AeonGames::Matrix4x4::GetRotationMatrix ( float angle,
float x,
float y,
float z )
static

Constructs the rotation matrix defined by the axis-angle provided.

The Matrix returned is a 4x4 matrix constructed using the same formula glRotate* uses.

Parameters
angle[in] Angle in degrees of rotation.
x[in] X element of axis of rotation.
y[in] Y element of axis of rotation.
z[in] Z element of axis of rotation.
Returns
Rotation matrix.

Definition at line 180 of file Matrix4x4.cpp.

◆ Invert()

Matrix4x4 & AeonGames::Matrix4x4::Invert ( )

Invert this matrix in place.

Returns
Reference to this matrix after inversion.

Definition at line 58 of file Matrix4x4.cpp.

◆ operator*=()

Matrix4x4 & AeonGames::Matrix4x4::operator*= ( const Matrix4x4 & lhs)

Multiply this matrix by another matrix.

Definition at line 142 of file Matrix4x4.cpp.

◆ operator[]()

const float AeonGames::Matrix4x4::operator[] ( size_t aIndex) const

Access a matrix element by index.

Definition at line 174 of file Matrix4x4.cpp.

◆ Ortho()

void AeonGames::Matrix4x4::Ortho ( float aLeft,
float aRight,
float aBottom,
float aTop,
float aNear,
float aFar )

Set up an orthographic projection matrix.

Parameters
aLeftLeft vertical clipping plane.
aRightRight vertical clipping plane.
aBottomBottom horizontal clipping plane.
aTopTop horizontal clipping plane.
aNearNear depth clipping plane distance.
aFarFar depth clipping plane distance.
Note
This function is yet to be tested for correctness.

Definition at line 97 of file Matrix4x4.cpp.

◆ Perspective()

void AeonGames::Matrix4x4::Perspective ( float aFieldOfVision,
float aAspect,
float aNear,
float aFar )

Set up a symmetric perspective projection matrix.

Parameters
aFieldOfVisionVertical field of vision angle in degrees.
aAspectAspect ratio (width / height).
aNearNear depth clipping plane distance.
aFarFar depth clipping plane distance.

Definition at line 127 of file Matrix4x4.cpp.

◆ Rotate()

Matrix4x4 & AeonGames::Matrix4x4::Rotate ( float angle,
float x,
float y,
float z )

Apply a rotation to this matrix.

Parameters
angleAngle in degrees of rotation.
xX component of the axis of rotation.
yY component of the axis of rotation.
zZ component of the axis of rotation.
Returns
Reference to this matrix after rotation.

Definition at line 134 of file Matrix4x4.cpp.

Member Data Documentation

◆ Identity

const Matrix4x4 AeonGames::Matrix4x4::Identity {}
static

The 4x4 identity matrix constant.

Definition at line 119 of file Matrix4x4.hpp.

◆ mMatrix

float AeonGames::Matrix4x4::mMatrix[16]
protected

Lineal row mayor matrix.

Definition at line 122 of file Matrix4x4.hpp.


The documentation for this class was generated from the following files: