|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
4x4 column-major transformation matrix. More...
#include <Math3D.hpp>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | Matrix4 () noexcept=default |
| Default constructor. Initializes to zero matrix. | |
| constexpr | Matrix4 (const std::array< T, 16 > &raw) noexcept |
| Constructs matrix from column-major elements array. | |
| constexpr T & | operator() (std::size_t row_idx, std::size_t col_idx) noexcept |
| Element accessor by (row, column). | |
| constexpr const T & | operator() (std::size_t row_idx, std::size_t col_idx) const noexcept |
| constexpr const std::array< T, 16 > & | data () const noexcept |
| constexpr std::array< T, 16 > & | data () noexcept |
| constexpr Vector4< T > | operator* (const Vector4< T > &vec) const noexcept |
| Matrix-vector multiplication. | |
| constexpr Matrix4 | operator* (const Matrix4 &rhs) const noexcept |
| Matrix-matrix multiplication. | |
| constexpr math::Vector3< T > | transformPoint (const math::Vector3< T > &point) const noexcept |
| Transforms a 3D point (w = 1) with perspective division. | |
| constexpr math::Vector3< T > | transformDirection (const math::Vector3< T > &direction) const noexcept |
| Transforms a 3D direction vector (w = 0). | |
| constexpr Matrix4 | transpose () const noexcept |
| Transposes the matrix. | |
Static Public Member Functions | |
| static constexpr Matrix4 | identity () noexcept |
| Creates a 4x4 identity matrix. | |
| static constexpr Matrix4 | translation (T offset_x, T offset_y, T offset_z) noexcept |
| Creates a translation matrix. | |
| static constexpr Matrix4 | translation (const math::Vector3< T > &offset) noexcept |
| static constexpr Matrix4 | scaling (T scale_x, T scale_y, T scale_z) noexcept |
| Creates a non-uniform scaling matrix. | |
| static constexpr Matrix4 | scaling (T uniform_scale) noexcept |
| static Matrix4 | lookAt (const math::Vector3< T > &eye, const math::Vector3< T > &target, const math::Vector3< T > &up_direction) |
| Generates a Look-At view matrix (Right-Handed). | |
| static Matrix4 | perspective (T fov_y_rad, T aspect, T z_near, T z_far) |
| Generates perspective projection matrix (RH, depth in [0, 1] suitable for Vulkan/Software). | |
| static Matrix4 | orthographic (T left, T right, T bottom, T top, T z_near, T z_far) |
| Generates orthographic projection matrix (RH, depth in [0, 1]). | |
Private Attributes | |
| std::array< T, 16 > | data_ {} |
4x4 column-major transformation matrix.
| T | Floating-point scalar type. |
| using correlation::render3d::Matrix4< T >::value_type = T |
|
constexprdefaultnoexcept |
Default constructor. Initializes to zero matrix.

|
inlineexplicitconstexprnoexcept |
Constructs matrix from column-major elements array.
| raw | 16-element array in column-major order. |

|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinestaticnodiscardconstexprnoexcept |
Creates a 4x4 identity matrix.


|
inlinestaticnodiscard |
Generates a Look-At view matrix (Right-Handed).
| eye | Camera eye position. |
| target | Target look-at point. |
| up_direction | World up vector. |


|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Element accessor by (row, column).
| row_idx | Row index in [0, 3]. |
| col_idx | Column index in [0, 3]. |
|
inlinenodiscardconstexprnoexcept |
Matrix-matrix multiplication.
| rhs | Right-hand side matrix. |

|
inlinenodiscardconstexprnoexcept |
Matrix-vector multiplication.
| vec | 4D vector. |
|
inlinestaticnodiscard |
Generates orthographic projection matrix (RH, depth in [0, 1]).
| left | Left boundary. |
| right | Right boundary. |
| bottom | Bottom boundary. |
| top | Top boundary. |
| z_near | Near plane. |
| z_far | Far plane. |


|
inlinestaticnodiscard |
Generates perspective projection matrix (RH, depth in [0, 1] suitable for Vulkan/Software).
| fov_y_rad | Vertical field of view in radians. |
| aspect | Viewport aspect ratio (width / height). |
| z_near | Near clipping plane distance (> 0). |
| z_far | Far clipping plane distance (> z_near). |


|
inlinestaticnodiscardconstexprnoexcept |
Creates a non-uniform scaling matrix.
| scale_x | Scale in X. |
| scale_y | Scale in Y. |
| scale_z | Scale in Z. |


|
inlinestaticnodiscardconstexprnoexcept |

|
inlinenodiscardconstexprnoexcept |
Transforms a 3D direction vector (w = 0).
| direction | 3D direction. |

|
inlinenodiscardconstexprnoexcept |
Transforms a 3D point (w = 1) with perspective division.
| point | 3D point. |

|
inlinestaticnodiscardconstexprnoexcept |

|
inlinestaticnodiscardconstexprnoexcept |
Creates a translation matrix.
| offset_x | Translation in X. |
| offset_y | Translation in Y. |
| offset_z | Translation in Z. |


|
inlinenodiscardconstexprnoexcept |
Transposes the matrix.

|
private |