|
| constexpr | t_Matrix3 () |
| | Default constructor.
|
| |
| constexpr | t_Matrix3 (T v) |
| | Constructs a diagonal matrix with the same value on the diagonal.
|
| |
| constexpr | t_Matrix3 (T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8) |
| | Constructs a matrix from nine individual elements.
|
| |
| constexpr | t_Matrix3 (T v[9]) |
| | Constructs a matrix from an array of nine elements.
|
| |
| constexpr | t_Matrix3 (const t_Vector3< T > &c0, const t_Vector3< T > &c1, const t_Vector3< T > &c2) |
| | Constructs a matrix from three column vectors.
|
| |
| template<typename R > |
| | t_Matrix3 (const t_Matrix3< R > &rhs) |
| | Type-converting constructor.
|
| |
| constexpr size_t | size () const |
| | Gets the total number of elements in the matrix.
|
| |
| constexpr size_t | columns () const |
| | Gets the number of columns in the matrix.
|
| |
| constexpr size_t | rows () const |
| | Gets the number of rows in the matrix.
|
| |
| t_Vector3< T > & | operator[] (size_t c) |
| | Column access operator (mutable).
|
| |
| const t_Vector3< T > & | operator[] (size_t c) const |
| | Column access operator (const).
|
| |
| T & | operator() (size_t c, size_t r) |
| | Element access operator (mutable).
|
| |
| T | operator() (size_t c, size_t r) const |
| | Element access operator (const).
|
| |
| template<typename R > |
| t_Matrix3 & | operator= (const t_Matrix3< R > &rhs) |
| | Type-converting assignment operator.
|
| |
| void | set (T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8) |
| | Sets all nine matrix elements.
|
| |
| template<typename R > |
| void | set (const t_Matrix3< R > &rhs) |
| | Sets this matrix equal to another matrix.
|
| |
| T * | data () |
| | Gets a pointer to the underlying data.
|
| |
| const T * | data () const |
| | Gets a const pointer to the underlying data.
|
| |
| t_Matrix3 | operator* (const t_Matrix3 &rhs) const |
| | Matrix multiplication operator.
|
| |
| t_Matrix3 & | operator*= (const t_Matrix3 &rhs) |
| | Matrix multiplication assignment operator.
|
| |
| t_Matrix3 | operator* (T scalar) const |
| | Scalar multiplication operator.
|
| |
| t_Matrix3 & | operator*= (T scalar) |
| | Scalar multiplication assignment operator.
|
| |
| t_Vector3< T > | operator* (const t_Vector3< T > &v) const |
| | Matrix-vector multiplication operator.
|
| |
| t_Matrix3 | operator+ (const t_Matrix3 &rhs) const |
| | Matrix addition operator.
|
| |
| t_Matrix3 & | operator+= (const t_Matrix3 &rhs) |
| | Matrix addition assignment operator.
|
| |
| t_Matrix3 | operator- (const t_Matrix3 &rhs) const |
| | Matrix subtraction operator.
|
| |
| t_Matrix3 & | operator-= (const t_Matrix3 &rhs) |
| | Matrix subtraction assignment operator.
|
| |
| t_Matrix3 | operator/ (T scalar) const |
| | Scalar division operator.
|
| |
| t_Matrix3 & | operator/= (T scalar) |
| | Scalar division assignment operator.
|
| |
| bool | operator== (const t_Matrix3 &rhs) const |
| | Equality comparison operator.
|
| |
| bool | operator!= (const t_Matrix3 &rhs) const |
| | Inequality comparison operator.
|
| |
| bool | operator< (const t_Matrix3 &rhs) const |
| | Less-than comparison operator for ordering.
|
| |
| t_Matrix3 | transpose () const |
| | Computes the transpose of this matrix.
|
| |
| t_Matrix3 | operator- () const |
| | Unary negation operator.
|
| |
| | operator bool () const noexcept |
| | Boolean conversion operator.
|
| |
template<typename T>
struct Infinity::Types::Math::t_Matrix3< T >
Template structure representing a 3x3 matrix.
t_Matrix3 provides a column-major 3x3 matrix implementation suitable for representing 2D transformations in homogeneous coordinates and 3D rotations/scales. The matrix is stored as three column vectors, following the convention used by modern graphics APIs and mathematics libraries.
Common applications in procedural generation:
- 2D transformations (rotation, scale, translation in homogeneous coordinates)
- 3D rotation matrices (without translation)
- Normal matrix transformations (inverse transpose of model matrix)
- Texture coordinate transformations
- Basis transformations and coordinate system changes
- Tensor operations in procedural algorithms
Matrix layout (column-major):
t_Vector3< T > value[3]
Column vectors comprising the matrix.
Definition Matrix3.hpp:91
The template parameter allows instantiation with different numeric types (float, double) to match precision requirements.
Example usage:
float angle = M_PI / 4.0f;
std::cos(angle), std::sin(angle), 0,
-std::sin(angle), std::cos(angle), 0,
0, 0, 1
);
2.0f, 0, 0,
0, 3.0f, 0,
0, 0, 1.0f
);
Matrix3 transform = scale * rotation;
Vector3 transformed = transform * point;
Template structure representing a 3x3 matrix.
Definition Matrix3.hpp:83
t_Matrix3 transpose() const
Computes the transpose of this matrix.
Definition Matrix3.hpp:646
Template structure representing a 3-component vector.
Definition Vector3.hpp:82
- Template Parameters
-
| T | The numeric type for matrix elements (float, double). |
- Note
- Matrices are stored in column-major order for compatibility with OpenGL and modern graphics APIs.
-
Matrix-vector multiplication treats vectors as column vectors.
- See also
- Matrix3, Matrix3d
-
t_Vector3