|
Gin
|
A 4x4 matrix class for 3D transformations. More...
#include <gin_mat4.h>
Public Member Functions | |
| Mat4 () | |
| Mat4 | operator* (const Mat4 &other) const |
| Matrix multiplication. | |
| Vec3< T > | transformPoint (const Vec3< T > &v) const |
| Transform a 3D point (applies full transformation including translation). | |
| Vec3< T > | transformVector (const Vec3< T > &v) const |
| Transform a 3D vector (applies rotation/scale only, no translation). | |
| std::array< T, 4 > | project (const Vec3< T > &v) const |
| Project a point and return clip-space coordinates (x, y, z, w). | |
Static Public Member Functions | |
| static Mat4 | identity () |
| Creates an identity matrix. | |
| static Mat4 | translation (T x, T y, T z) |
| Creates a translation matrix. | |
| static Mat4 | translation (const Vec3< T > &v) |
| static Mat4 | scale (T x, T y, T z) |
| Creates a scaling matrix. | |
| static Mat4 | scale (T s) |
| static Mat4 | rotationX (T angle) |
| Creates a rotation matrix around the X axis (angle in radians). | |
| static Mat4 | rotationY (T angle) |
| Creates a rotation matrix around the Y axis (angle in radians). | |
| static Mat4 | rotationZ (T angle) |
| Creates a rotation matrix around the Z axis (angle in radians). | |
| static Mat4 | perspective (T fovY, T aspect, T nearZ, T farZ) |
| Creates a perspective projection matrix. | |
| static Mat4 | orthographic (T left, T right, T bottom, T top, T nearZ, T farZ) |
| Creates an orthographic projection matrix. | |
| static Mat4 | lookAt (const Vec3< T > &eye, const Vec3< T > &target, const Vec3< T > &up) |
| Creates a look-at view matrix. | |
Public Attributes | |
| std::array< std::array< T, 4 >, 4 > | m |
A 4x4 matrix class for 3D transformations.
Stored in column-major order for OpenGL compatibility.
| Mat4< T >::Mat4 | ( | ) |
Referenced by Mat4< float >::identity().
Creates a translation matrix.
Referenced by Mat4< float >::translation().
Creates a scaling matrix.
Referenced by Mat4< float >::scale().
Creates a rotation matrix around the X axis (angle in radians).
Creates a rotation matrix around the Y axis (angle in radians).
Creates a rotation matrix around the Z axis (angle in radians).
Creates a perspective projection matrix.
| fovY | Field of view in the Y direction (radians) |
| aspect | Aspect ratio (width / height) |
| nearZ | Near clipping plane |
| farZ | Far clipping plane |
|
static |
Creates an orthographic projection matrix.
|
static |
Creates a look-at view matrix.
Matrix multiplication.
Transform a 3D point (applies full transformation including translation).
Transform a 3D vector (applies rotation/scale only, no translation).
Project a point and return clip-space coordinates (x, y, z, w).
Referenced by Renderer3D::render().
| std::array<std::array<T, 4>, 4> Mat4< T >::m |