|
| constexpr | Matrix () noexcept |
| | Identity matrix.
|
| |
| constexpr | Matrix (T value) noexcept |
| | Matrix with every element set to value.
|
| |
| constexpr | Matrix (std::initializer_list< T > list) |
| | Elements in row-major order.
|
| |
| constexpr T & | operator[] (size_t index) noexcept |
| | Element at index in row-major order.
|
| |
| constexpr const T & | operator[] (size_t index) const noexcept |
| |
| constexpr T & | operator() (size_t row, size_t col) noexcept |
| | Element at row and col.
|
| |
| constexpr const T & | operator() (size_t row, size_t col) const noexcept |
| |
| constexpr T * | data () noexcept |
| | The elements in row-major order.
|
| |
| constexpr const T * | data () const noexcept |
| |
| constexpr bool | operator== (const Matrix &) const noexcept=default |
| |
| constexpr Matrix & | operator+= (const Matrix &other) noexcept |
| |
| constexpr Matrix & | operator-= (const Matrix &other) noexcept |
| |
| constexpr Matrix & | operator*= (T scalar) noexcept |
| |
| constexpr Matrix & | operator*= (const Matrix &other) noexcept |
| |
| constexpr Matrix< T, Rows, Cols > | operator+ (const Matrix< T, Rows, Cols > &other) const noexcept |
| |
| constexpr Matrix< T, Rows, Cols > | operator- (const Matrix< T, Rows, Cols > &other) const noexcept |
| |
| template<size_t P> |
| constexpr Matrix< T, Rows, P > | operator* (const Matrix< T, Cols, P > &other) const noexcept |
| |
| constexpr Matrix< T, Rows, Cols > | operator* (T scalar) const noexcept |
| |
| constexpr Vector3D< T > | transformPoint (const Vector3D< T > &p) const |
| | Transforms a point, translation included.
|
| |
| constexpr Vector3D< T > | transformDirection (const Vector3D< T > &d) const |
| | Transforms a direction, ignoring the translation.
|
| |
| constexpr Matrix< T, Cols, Rows > | transpose () const noexcept |
| |
| constexpr T | determinant () const noexcept |
| | Determinant of a square matrix; above 3x3, T must be a floating-point type.
|
| |
| constexpr Matrix< T, Rows, Cols > | inverse () const |
| | Inverse of a square matrix.
|
| |
|
| static constexpr size_t | rows () noexcept |
| |
| static constexpr size_t | cols () noexcept |
| |
| static constexpr Matrix< T, Rows, Cols > | translation (T x, T y, T z) noexcept |
| | Translation matrix, 4x4 or larger.
|
| |
| static constexpr Matrix< T, Rows, Cols > | translation (const Vector3D< T > &v) noexcept |
| |
| static constexpr Matrix< T, Rows, Cols > | scale (T sx, T sy, T sz) noexcept |
| | Scaling matrix.
|
| |
| static constexpr Matrix< T, Rows, Cols > | scale (T s) noexcept |
| | Uniform scaling matrix.
|
| |
| static constexpr Matrix< T, Rows, Cols > | shear (T sxy, T sxz, T syx, T syz, T szx, T szy) noexcept |
| | Shearing matrix: sxy adds sxy * y to x, and so on.
|
| |
| static Matrix< T, Rows, Cols > | rotationX (T angleRad) |
| | Rotation of angleRad radians around the X axis.
|
| |
| static Matrix< T, Rows, Cols > | rotationY (T angleRad) |
| | Rotation of angleRad radians around the Y axis.
|
| |
| static Matrix< T, Rows, Cols > | rotationZ (T angleRad) |
| | Rotation of angleRad radians around the Z axis.
|
| |
| static constexpr Matrix< T, Rows, Cols > | identity () noexcept |
| |
| static Matrix< T, 4, 4 > | ortho (T left, T right, T bottom, T top, T nearP=T(-1), T farP=T(1)) |
| | OpenGL-style orthographic projection.
|
| |
| static Matrix< T, 4, 4 > | perspective (T fovYDeg, T aspect, T nearP, T farP) |
| | OpenGL-style perspective projection, with a vertical field of view in degrees.
|
| |
| static Matrix< T, 4, 4 > | lookAt (const Vector3D< T > &eye, const Vector3D< T > ¢er, const Vector3D< T > &up) |
| | Right-handed view matrix of a camera at eye looking at center.
|
| |
template<typename T, size_t Rows, size_t Cols>
class RST::Maths::Matrix< T, Rows, Cols >
Fixed-size matrix of Rows x Cols elements, stored in row-major order.
Transformations apply to column vectors: translation * rotation rotates first, then translates.
- Examples
- graphics.cpp.