|
My Project
|
4x4 Matrix class template for 3D transformations Supports translation, rotation, scaling, multiplication, inversion, and more More...
#include <MMatrix4.hpp>
Public Member Functions | |
| Mat4 () | |
| Default constructor (uninitialized matrix). | |
| Mat4 (T u, T d, T t, T q, T c, T si, T se, T h, T n, T di, T on, T dou, T tre, T qua, T qui, T sei) | |
| Constructor with 16 individual elements (row-major order). | |
| ~Mat4 ()=default | |
| Mat4 | Rotation4x4 (T angleX, T angleY, T angleZ) |
| Compute rotation matrix from Euler angles (degrees). | |
| std::array< T, 16 > | Transpose4x4 (const Mat4 &mat) |
| Transpose the given 4x4 matrix. | |
| std::array< T, 16 > | Inverse4x4 () const |
| Compute inverse of this 4x4 matrix. | |
| Maths::Vec3< T > | LossyScale4x4 () const |
| Extract approximate scale from matrix. | |
| bool | isIdentity4x4 () const |
| Check if matrix is identity. | |
| T | Det4x4 () const |
| Compute determinant of the 4x4 matrix. | |
| T & | at (int r, int c) |
| Access matrix element at row r, column c. | |
| Maths::Vec3< T > | MultiplyPoint3x4_4x4 (const Vec3< T > &vector) const |
| Multiply a 3D point (Vec3) by 4x4 matrix. | |
| Maths::Vec3< T > | MultiplyVector4x4 (const Maths::Vec3< T > &vector) const |
| Multiply a vector (direction) by 4x4 matrix. | |
| Maths::Vec3< T > | MultiplyPoint4x4 (const Maths::Vec3< T > &vector) const |
| Multiply a point (Vec3) in homogeneous coordinates by 4x4 matrix. | |
| Maths::Vec3< T > | GetPosition4x4 () const |
| Extract position vector from matrix. | |
| Mat4 | SetTRS (const Vec3< T > &translation, const Vec3< T > &rotationEulerDeg, const Vec3< T > &scale) |
| Set matrix using Translation, Rotation (Euler deg), Scale. | |
| Mat4 | MultiplyMat4x4 (const Mat4 &A, const Mat4 &B) const |
| Multiply two 4x4 matrices. | |
| void | SetColumn4x4 (T columnNumber, T number1, T number2, T number3, T number4) |
| Set a specific column with 4 values. | |
| void | SetRow4x4 (T rowNumber, T number1, T number2, T number3, T number4) |
| Set a specific row with 4 values. | |
| void | GetColumn4x4 (T column) |
| Get a column (TODO: fix signature, currently just placeholder). | |
| void | GetRow4x4 (T row) |
| Get a row (TODO: fix signature, currently just placeholder). | |
| bool | ValidTRS () const |
| Check if this matrix is a valid TRS (Translation, Rotation, Scale) matrix. | |
| std::string | toString4x4 () const |
| Convert matrix to string (for debugging). | |
| Mat4 | operator* (const Mat4 &other) const |
| Matrix multiplication operator. | |
Static Public Member Functions | |
| static Mat4 | Identity () |
| Returns identity matrix (no transformation). | |
| static Mat4 | Zero () |
| Returns zero matrix. | |
| static Mat4 | TRS (const Maths::Vec3< T > &position, const Maths::Vec3< T > &rotationEuler, const Maths::Vec3< T > &scale) |
| static Mat4 | LookAt4x4 (const Maths::Vec3< T > &from, const Maths::Vec3< T > &to, const Maths::Vec3< T > &up) |
| static Mat4 | Ortho4x4 (T left, T right, T bottom, T top, T zNear, T zFar) |
| static Mat4 | Perspective4x4 (T fovY, T aspect, T nearP, T farP) |
| static Mat4 | TranslateVec4x4 (const Maths::Vec3< T > &t) |
| static Mat4 | Rotate4x4 (const Maths::Quat< T > &q) |
| static Mat4 | ScaleVec4x4 (const Maths::Vec3< T > &s) |
| static Mat4 | Translate4x4 (T tx, T ty, T tz) |
| static Mat4 | Scale4x4 (T sx, T sy, T sz) |
Public Attributes | |
| T | det |
| std::array< T, 16 > | tabMat |
| float | deg2rad = 3.14159265f / 180.f |
4x4 Matrix class template for 3D transformations Supports translation, rotation, scaling, multiplication, inversion, and more
| Maths::Mat4< T >::Mat4 | ( | ) |
Default constructor (uninitialized matrix).
| Maths::Mat4< T >::Mat4 | ( | T | u, |
| T | d, | ||
| T | t, | ||
| T | q, | ||
| T | c, | ||
| T | si, | ||
| T | se, | ||
| T | h, | ||
| T | n, | ||
| T | di, | ||
| T | on, | ||
| T | dou, | ||
| T | tre, | ||
| T | qua, | ||
| T | qui, | ||
| T | sei ) |
Constructor with 16 individual elements (row-major order).
|
default |
| T & Maths::Mat4< T >::at | ( | int | r, |
| int | c ) |
Access matrix element at row r, column c.
| T Maths::Mat4< T >::Det4x4 | ( | ) | const |
Compute determinant of the 4x4 matrix.
| void Maths::Mat4< T >::GetColumn4x4 | ( | T | column | ) |
Get a column (TODO: fix signature, currently just placeholder).
| Maths::Vec3< T > Maths::Mat4< T >::GetPosition4x4 | ( | ) | const |
Extract position vector from matrix.
| void Maths::Mat4< T >::GetRow4x4 | ( | T | row | ) |
Get a row (TODO: fix signature, currently just placeholder).
|
static |
Returns identity matrix (no transformation).
| std::array< T, 16 > Maths::Mat4< T >::Inverse4x4 | ( | ) | const |
Compute inverse of this 4x4 matrix.
| bool Maths::Mat4< T >::isIdentity4x4 | ( | ) | const |
Check if matrix is identity.
|
static |
| Maths::Vec3< T > Maths::Mat4< T >::LossyScale4x4 | ( | ) | const |
Extract approximate scale from matrix.
| Mat4 Maths::Mat4< T >::MultiplyMat4x4 | ( | const Mat4< T > & | A, |
| const Mat4< T > & | B ) const |
Multiply two 4x4 matrices.
| Maths::Vec3< T > Maths::Mat4< T >::MultiplyPoint3x4_4x4 | ( | const Vec3< T > & | vector | ) | const |
Multiply a 3D point (Vec3) by 4x4 matrix.
| Maths::Vec3< T > Maths::Mat4< T >::MultiplyPoint4x4 | ( | const Maths::Vec3< T > & | vector | ) | const |
Multiply a point (Vec3) in homogeneous coordinates by 4x4 matrix.
| Maths::Vec3< T > Maths::Mat4< T >::MultiplyVector4x4 | ( | const Maths::Vec3< T > & | vector | ) | const |
Multiply a vector (direction) by 4x4 matrix.
| Mat4 Maths::Mat4< T >::operator* | ( | const Mat4< T > & | other | ) | const |
Matrix multiplication operator.
OPERATORS //////////
|
static |
|
static |
|
static |
| Mat4 Maths::Mat4< T >::Rotation4x4 | ( | T | angleX, |
| T | angleY, | ||
| T | angleZ ) |
Compute rotation matrix from Euler angles (degrees).
|
static |
|
static |
| void Maths::Mat4< T >::SetColumn4x4 | ( | T | columnNumber, |
| T | number1, | ||
| T | number2, | ||
| T | number3, | ||
| T | number4 ) |
Set a specific column with 4 values.
| void Maths::Mat4< T >::SetRow4x4 | ( | T | rowNumber, |
| T | number1, | ||
| T | number2, | ||
| T | number3, | ||
| T | number4 ) |
Set a specific row with 4 values.
| Mat4 Maths::Mat4< T >::SetTRS | ( | const Vec3< T > & | translation, |
| const Vec3< T > & | rotationEulerDeg, | ||
| const Vec3< T > & | scale ) |
Set matrix using Translation, Rotation (Euler deg), Scale.
| std::string Maths::Mat4< T >::toString4x4 | ( | ) | const |
Convert matrix to string (for debugging).
|
static |
|
static |
| std::array< T, 16 > Maths::Mat4< T >::Transpose4x4 | ( | const Mat4< T > & | mat | ) |
Transpose the given 4x4 matrix.
|
static |
| bool Maths::Mat4< T >::ValidTRS | ( | ) | const |
Check if this matrix is a valid TRS (Translation, Rotation, Scale) matrix.
|
static |
Returns zero matrix.
| float Maths::Mat4< T >::deg2rad = 3.14159265f / 180.f |
| T Maths::Mat4< T >::det |
| std::array<T, 16> Maths::Mat4< T >::tabMat |