Matrix with 3x3 elements. More...
#include <kanzi/core/math/matrix3x3.hpp>
Public Member Functions | |
| constexpr Vector3 | getColumn (size_t index) const |
| Gets the column of a matrix. | |
| float | getRotationAngle () const |
| Get rotation angle of the matrix. | |
| constexpr Vector3 | getRow (size_t index) const |
| Gets the row of a matrix. | |
| Vector2 | getScale () const |
| Get scale as a vector. | |
| float | getScaleX () const |
| Get X scale component. | |
| float | getScaleY () const |
| Get Y scale component. | |
| constexpr Vector2 | getTranslation () const |
| Get translation. | |
| constexpr float | getTranslationX () const |
| Get translation on X axis. | |
| constexpr float | getTranslationY () const |
| Get translation on Y axis. | |
| constexpr Vector2 | getXAxis () const |
| Get X axis. | |
| constexpr Vector2 | getYAxis () const |
| Get Y axis. | |
| constexpr | Matrix3x3 () |
| Default constructor. | |
| constexpr | Matrix3x3 (float value) |
| Constructor. | |
| constexpr | Matrix3x3 (float x0, float x1, float x2, float x3, float x4, float x5, float x6, float x7, float x8) |
| Constructs the matrix from elements in column-major order. | |
| constexpr | Matrix3x3 (Vector2 x, Vector2 y, Vector2 translation) |
| Constructs the matrix from three column vectors. | |
| constexpr | Matrix3x3 (Vector3 x, Vector3 y, Vector3 translation) |
| Constructs the matrix from three column vectors. | |
| constexpr Matrix3x3 & | operator*= (const Matrix3x3 &m) |
| Modifies this matrix by multiplying it with another matrix. | |
| constexpr Matrix3x3 & | operator+= (const Matrix3x3 &m) |
| Modifies this matrix by adding another matrix. | |
| constexpr Matrix3x3 & | operator-= (const Matrix3x3 &m) |
| Modifies this matrix by subtracting another matrix from this matrix. | |
| constexpr float & | operator[] (size_t index) |
| Access to individual elements of the matrix. | |
| constexpr const float & | operator[] (size_t index) const |
| Access to individual elements of the matrix. | |
| constexpr void | scale (Vector2 v) |
| Scales this matrix. | |
| constexpr void | setColumn (size_t index, Vector3 column) |
| Sets the column of a matrix. | |
| constexpr void | setRow (size_t index, Vector3 row) |
| Sets the row of a matrix. | |
| constexpr void | setTranslation (float translationX, float translationY) |
| Set translation. | |
| constexpr void | setTranslation (Vector2 translation) |
| Set translation. | |
| constexpr void | setTranslationX (float translationX) |
| Set translation on X axis. | |
| constexpr void | setTranslationY (float translationY) |
| Set translation on Y axis. | |
| constexpr void | setXAxis (Vector2 v) |
| Set X axis. | |
| constexpr void | setYAxis (Vector2 v) |
| Set Y axis. | |
| constexpr void | translate (Vector2 v) |
| Translates this matrix. | |
| constexpr Matrix3x3 | transposed () const |
| Applies a transpose to a matrix. | |
Static Public Member Functions | |
| static constexpr Matrix3x3 | createFilled (float value) |
Creates a matrix with all elements set to value. | |
| static constexpr Matrix3x3 | createIdentity () |
| Creates identity matrix. | |
| static Matrix3x3 | createRotationInDegrees (float angleInDegrees) |
| Creates a rotation matrix. | |
| static Matrix3x3 | createRotationInRadians (float angleInRadians) |
| Creates a rotation matrix. | |
| static constexpr Matrix3x3 | createScale (Vector2 scale) |
| Creates a scaled matrix. | |
| static Matrix3x3 | createSRT (Vector2 scale, float rotationInRadians, Vector2 translation) |
| Create an SRT matrix. | |
| static constexpr Matrix3x3 | createTranslation (float x, float y) |
| Creates translation matrix. | |
| static constexpr Matrix3x3 | createTranslation (Vector2 translation) |
| Creates translation matrix. | |
Matrix with 3x3 elements.
|
inlineexplicitconstexpr |
Default constructor.
Initializes the matrix to identity matrix.
Constructor.
Initializes every component to the same value.
|
inlineexplicitconstexpr |
Constructs the matrix from elements in column-major order.
| x0 | First column first component. |
| x1 | First column second component. |
| x2 | First column third component. |
| x3 | Second column first component. |
| x4 | Second column second component. |
| x5 | Second column third component. |
| x6 | Third column first component. |
| x7 | Third column second component. |
| x8 | Third column third component. |
|
inlineexplicitconstexpr |
Constructs the matrix from three column vectors.
| x | First column vector. |
| y | Second column vector. |
| translation | Translation vector. |
|
inlineexplicitconstexpr |
Constructs the matrix from three column vectors.
| x | First column vector. |
| y | Second column vector. |
| translation | Translation vector. |
Access to individual elements of the matrix.
Elements are stored in column-major order.
| index | Index of the accessed element. Possible values are numbers from 0 to 8. |
Access to individual elements of the matrix.
Elements are stored in column-major order.
| index | Index of the accessed element. Possible values are numbers from 0 to 8. |
Gets the row of a matrix.
| index | Index of the accessed row. |
Gets the column of a matrix.
| index | Index of the accessed column. |
Sets the row of a matrix.
| index | Index of the accessed row. |
| row | The value to set to the row. |
Sets the column of a matrix.
| index | Index of the accessed column. |
| column | The value to set to the column. |
|
inline |
Get X scale component.
|
inline |
Get Y scale component.
|
inline |
Get scale as a vector.
Scales this matrix.
| v | Scaling vector. |
Translates this matrix.
| v | Translation vector. |
Set X axis.
| v | X axis vector. |
Set Y axis.
| v | Y axis vector. |
Set translation.
| translation | Translation vector. |
|
inlineconstexpr |
Set translation.
| translationX | Translation X component. |
| translationY | Translation Y component. |
Get translation.
Get translation on X axis.
Set translation on X axis.
| translationX | Translation X component. |
Get translation on Y axis.
Set translation on Y axis.
| translationY | Translation Y component. |
| float kanzi::Matrix3x3::getRotationAngle | ( | ) | const |
Get rotation angle of the matrix.
Modifies this matrix by adding another matrix.
| m | Another matrix. |
Modifies this matrix by subtracting another matrix from this matrix.
| m | Another matrix. |
Modifies this matrix by multiplying it with another matrix.
| m | Another matrix. |
|
inlinestaticconstexpr |
Creates translation matrix.
| translation | Translation vector. |
|
inlinestaticconstexpr |
Creates translation matrix.
| x | X component of the Translation vector. |
| y | Y component of the Translation vector. |
Creates a scaled matrix.
| scale | Scaling vector. |
Creates identity matrix.
Creates a rotation matrix.
| angleInDegrees | Rotation angle in degrees. |
Creates a rotation matrix.
| angleInRadians | Rotation angle in radians. |
|
static |
Create an SRT matrix.
| scale | Scales by axises. |
| rotationInRadians | Rotation component in radians. |
| translation | Translation component. |
Creates a matrix with all elements set to value.
| value | Value to set to all elements. |
Applies a transpose to a matrix.