Matrix4
A 4x4 matrix class for mathematical operations.
Stores the matrix in column-major order using four Vector4 columns. Commonly used for 3D transformations including translation, rotation, scaling, and projection.
Functions
Matrix4() constexpr
cpp
vglx::Matrix4::Matrix4(const Vector4 &a, const Vector4 &b, const Vector4 &c, const Vector4 &d)
Parameter | Description |
---|---|
a | First column vector. |
b | Second column vector. |
c | Third column vector. |
d | Fourth column vector. |
Constructs a Matrix4 object from four column vectors.
Matrix4() constexpr
cpp
vglx::Matrix4::Matrix4(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
Parameter | Description |
---|---|
n00 | First row, first element. |
n01 | First row, second element. |
n02 | First row, third element. |
n03 | First row, fourth element. |
n10 | Second row, first element. |
n11 | Second row, second element. |
n12 | Second row, third element. |
n13 | Second row, fourth element. |
n20 | Third row, first element. |
n21 | Third row, second element. |
n22 | Third row, third element. |
n23 | Third row, fourth element. |
n30 | Fourth row, first element. |
n31 | Fourth row, second element. |
n32 | Fourth row, third element. |
n33 | Fourth row, fourth element. |
Constructs a Matrix4 object from individual components (row-major).
Matrix4() constexpr
cpp
vglx::Matrix4::Matrix4(float value)
Parameter | Description |
---|---|
value | Value to place on the diagonal. |
Constructs a diagonal Matrix4 with the given scalar value.
operator()() auto &
cpp
auto & vglx::Matrix4::operator()(int i, int j)
Parameter | Description |
---|---|
i | Row index (0 to 3). |
j | Column index (0 to 3). |
Access matrix element by (row, column).
operator()() const auto &
cpp
const auto & vglx::Matrix4::operator()(int i, int j) const
Parameter | Description |
---|---|
i | Row index (0 to 3). |
j | Column index (0 to 3). |
Access matrix element by (row, column) (const).
operator[]() auto &
cpp
auto & vglx::Matrix4::operator[](int j)
Parameter | Description |
---|---|
j | Column index (0 to 3). |
Access matrix column vector by index.
operator[]() const auto &
cpp
const auto & vglx::Matrix4::operator[](int j) const
Parameter | Description |
---|---|
j | Column index (0 to 3). |
Access matrix column vector by index (const).
Matrix4::Identity() auto
cpp
static constexpr auto vglx::Matrix4::Identity()
Returns the identity matrix.
Determinant() VGLX_EXPORT constexpr auto
cpp
VGLX_EXPORT constexpr auto Determinant(const Matrix4 &m)
Parameter | Description |
---|---|
m | Input matrix. |
Computes the determinant of a Matrix4 object.