|
|
| IMatrix () |
| | Builds an identity matrix.
|
| | IMatrix (float *p_values) |
| | Builds a matrix from a contiguous column-major array.
|
| | IMatrix (std::initializer_list< float > p_values) |
| | Builds from a flat initializer list (column-major).
|
| Column & | operator[] (size_t p_index) |
| | Accesses a column.
|
| const Column & | operator[] (size_t p_index) const |
| | Accesses a column.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| Vector3 | operator* (const Vector3 &p_vec) const |
| | Transforms a 3D vector with a 3x3 matrix (homogeneous w=1).
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| Vector3 | operator* (const Vector3 &p_vec) const |
| | Transforms a 3D vector with a 4x4 matrix (homogeneous projection).
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| Vector2 | operator* (const Vector2 &p_vec) const |
| | Transforms a 2D vector with a 3x3 matrix (homogeneous).
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| Vector4 | operator* (const Vector4 &p_vec) const |
| | Transforms a 4D vector with a 4x4 matrix.
|
| IMatrix< SizeX, SizeY > | operator* (const IMatrix< SizeX, SizeY > &p_other) const |
| | Multiplies two matrices of the same dimensions.
|
| bool | operator== (const IMatrix &p_other) const |
| | Compares two matrices with tolerant float comparison.
|
| bool | operator!= (const IMatrix &p_other) const |
| | Inequality helper.
|
| std::wstring | toWstring () const |
| | Converts the matrix to a wide string representation.
|
| std::string | toString () const |
| | Converts the matrix to a string representation.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==Y), int > = 0> |
| float | determinant () const |
| | Computes determinant for square matrices.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==Y), int > = 0> |
| bool | isInvertible () const |
| | Checks if the matrix is invertible (determinant non-zero).
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==Y), int > = 0> |
| IMatrix< SizeX, SizeY > | inverse () const |
| | Returns the inverse of a square matrix.
|
|
| static spk::IMatrix< SizeX, SizeY > | identity () |
| | Returns an identity matrix of the same dimension.
|
| static IMatrix< 4, 4 > | rotation (float p_angleX, float p_angleY, float p_angleZ) |
| | Builds a 4x4 rotation matrix from Euler angles in degrees.
|
| static IMatrix< 4, 4 > | rotation (spk::Vector3 p_angle) |
| | Builds a 4x4 rotation matrix from Euler components in degrees.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| static IMatrix< 4, 4 > | rotation (const spk::Quaternion &p_q) |
| | Converts a quaternion to a 4x4 rotation matrix.
|
| static IMatrix< 4, 4 > | translation (float p_translateX, float p_translateY, float p_translateZ) |
| | Builds a translation matrix.
|
| static IMatrix< 4, 4 > | translation (spk::Vector3 p_translation) |
| | Builds a translation matrix from a vector.
|
| static IMatrix< 4, 4 > | scale (float p_scaleX, float p_scaleY, float p_scaleZ) |
| | Builds a scale matrix.
|
| static IMatrix< 4, 4 > | scale (spk::Vector3 p_scale) |
| | Builds a scale matrix from a vector.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| static IMatrix | lookAt (const spk::Vector3 &p_from, const spk::Vector3 &p_to, const spk::Vector3 &p_up) |
| | Builds a view matrix looking from one point to another.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| static IMatrix | rotateAroundAxis (const spk::Vector3 &p_axis, const float &p_rotationAngle) |
| | Builds a rotation matrix around an arbitrary axis.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| static IMatrix | perspective (float p_fov, float p_aspectRatio, float p_nearPlane, float p_farPlane) |
| | Builds a perspective projection matrix.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==4 &&Y==4), int > = 0> |
| static IMatrix | ortho (float p_left, float p_right, float p_bottom, float p_top, float p_nearPlane, float p_farPlane) |
| | Builds an orthographic projection matrix.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| static IMatrix< 3, 3 > | translation (float p_translateX, float p_translateY) |
| | Creates a 2D translation matrix.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| static IMatrix< 3, 3 > | translation (const spk::Vector2 &p_translation) |
| | Creates a 2D translation matrix from a vector.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| static IMatrix< 3, 3 > | scale (float p_scaleX, float p_scaleY) |
| | Creates a 2D scale matrix.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| static IMatrix< 3, 3 > | scale (const spk::Vector2 &p_scale) |
| | Creates a 2D scale matrix from a vector.
|
| template<size_t X = SizeX, size_t Y = SizeY, typename std::enable_if_t<(X==3 &&Y==3), int > = 0> |
| static IMatrix< 3, 3 > | rotationZ (float p_angleDegrees) |
| | Creates a 2D rotation matrix around Z axis.
|
template<size_t SizeX, size_t SizeY>
class spk::IMatrix< SizeX, SizeY >
Column-major matrix with basic arithmetic, transforms, and helpers.
- Template Parameters
-
| SizeX | Number of columns. |
| SizeY | Number of rows. |
- See also
- Matrix2x2, Matrix3x3, Matrix4x4
spk::Vector3 world = proj * spk::Vector3{1,2,3};
static IMatrix perspective(float p_fov, float p_aspectRatio, float p_nearPlane, float p_farPlane)
Builds a perspective projection matrix.
Definition spk_matrix.hpp:592