struct
Mat4
- Module
- Math
- Header
#include "Math/Mat4.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
float[4][4] | m |
Constructors
Public functions
| Returns | Name | Description |
|---|---|---|
float* | operator[] | |
const float* | operator[] | |
Mat4 | operator* | |
Vec4 | operator* | |
Mat4 | Transposed | |
Mat4 | Transpose | |
Mat4 | Inverse | Returns identity if the matrix is singular. |
Mat4 | Identity | |
Mat4 | Translation | |
Mat4 | Translation | |
Mat4 | Scale | |
Mat4 | Scale | |
Mat4 | Scale | |
Mat4 | RotationX | |
Mat4 | RotationY | |
Mat4 | RotationZ | |
Mat4 | LookAt | |
Mat4 | Perspective | |
Mat4 | Orthographic | |
Mat4 | TRS | Create TRS matrix (Translation * Rotation * Scale) |
Mat4 | RotationFromQuaternion | |
const float* | Data | |
float* | Data | |
void | DecomposeMatrix | Decompose a TRS matrix into position, rotation (euler radians), and scale. |
Function details
Mat4
C++
Mat4()Mat4
C++
Mat4(float diagonal)operator[]
C++
float* operator[](int row)operator[]
C++
const float* operator[](int row) constoperator*
C++
Mat4 operator*(const Mat4& other) constoperator*
C++
Vec4 operator*(const Vec4& v) constTransposed
C++
Mat4 Transposed() constTranspose
C++
Mat4 Transpose() constInverse
C++
Mat4 Inverse() constReturns identity if the matrix is singular.
Identity
C++
static Mat4 Identity()Translation
C++
static Mat4 Translation(const Vec3& v)Translation
C++
static Mat4 Translation(float x, float y, float z)Scale
C++
static Mat4 Scale(const Vec3& v)Scale
C++
static Mat4 Scale(float x, float y, float z)Scale
C++
static Mat4 Scale(float uniform)RotationX
C++
static Mat4 RotationX(float angleRad)RotationY
C++
static Mat4 RotationY(float angleRad)RotationZ
C++
static Mat4 RotationZ(float angleRad)LookAt
C++
static Mat4 LookAt(const Vec3& eye, const Vec3& target, const Vec3& up)Perspective
C++
static Mat4 Perspective(float fovY, float aspect, float nearZ, float farZ)Orthographic
C++
static Mat4 Orthographic(float left, float right, float bottom, float top, float nearZ, float farZ)TRS
C++
static Mat4 TRS(const Vec3& translation, const Quat& rotation, const Vec3& scale)Create TRS matrix (Translation * Rotation * Scale)
RotationFromQuaternion
C++
static Mat4 RotationFromQuaternion(const Quat& q)Data
C++
const float* Data() constData
C++
float* Data()DecomposeMatrix
C++
static void DecomposeMatrix(const Mat4& mat, Vec3& outPos, Vec3& outRot, Vec3& outScale)Decompose a TRS matrix into position, rotation (euler radians), and scale. Row-major layout: translation at m[0][3], m[1][3], m[2][3]. The euler comes out in the engine's Rx * Ry * Rz order so it feeds straight back through Quat::FromEuler / TransformComponent::GetLocalMatrix without changing the rotation.
Generated from Math/Mat4.h via math.json · Nov 4, 2026Version 1.0.0