Matrix with 3x3 elements. More...
#include <kanzi/core/math/matrix3x3.hpp>
Public Member Functions | |
Vector3 | getColumn (size_t index) const |
Gets the column of a matrix. More... | |
float | getRotationAngle () const |
Get rotation angle of the matrix. More... | |
Vector3 | getRow (size_t index) const |
Gets the row of a matrix. More... | |
Vector2 | getScale () const |
Get scale as a vector. More... | |
float | getScaleX () const |
Get X scale component. More... | |
float | getScaleY () const |
Get Y scale component. More... | |
Vector2 | getTranslation () const |
Get translation. More... | |
float | getTranslationX () const |
Get translation on X axis. More... | |
float | getTranslationY () const |
Get translation on Y axis. More... | |
Vector2 | getXAxis () const |
Get X axis. More... | |
Vector2 | getYAxis () const |
Get Y axis. More... | |
Matrix3x3 () | |
Default constructor, initializes the matrix to identity matrix. More... | |
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. More... | |
Matrix3x3 (const Vector2 &x, const Vector2 &y, const Vector2 &translation) | |
Constructs the matrix from three column vectors. More... | |
Matrix3x3 & | operator*= (const Matrix3x3 &m) |
Modifies this matrix by multiplying it with another matrix. More... | |
Matrix3x3 & | operator+= (const Matrix3x3 &m) |
Modifies this matrix by adding another matrix. More... | |
Matrix3x3 & | operator-= (const Matrix3x3 &m) |
Modifies this matrix by subtracting another matrix from this matrix. More... | |
const float & | operator[] (size_t index) const |
Access to individual elements of the matrix. More... | |
float & | operator[] (size_t index) |
Access to individual elements of the matrix. More... | |
void | scale (const Vector2 &v) |
Scales this matrix. More... | |
void | setColumn (size_t index, const Vector3 &column) |
Sets the column of a matrix. More... | |
void | setRow (size_t index, const Vector3 &row) |
Sets the row of a matrix. More... | |
void | setTranslation (Vector2 translation) |
Set translation. More... | |
void | setTranslation (float translationX, float translationY) |
Set translation. More... | |
void | setTranslationX (float translationX) |
Set translation on X axis. More... | |
void | setTranslationY (float translationY) |
Set translation on Y axis. More... | |
void | setXAxis (Vector2 v) |
Set X axis. More... | |
void | setYAxis (Vector2 v) |
Set Y axis. More... | |
void | translate (const Vector2 &v) |
Translates this matrix. More... | |
Matrix3x3 | transposed () const |
Applies a transpose to a matrix. More... | |
Static Public Member Functions | |
static Matrix3x3 | createIdentity () |
Creates identity matrix. More... | |
static Matrix3x3 | createRotationInDegrees (float angleInDegrees) |
Creates a rotation matrix. More... | |
static Matrix3x3 | createRotationInRadians (float angleInRadians) |
Creates a rotation matrix. More... | |
static Matrix3x3 | createScale (Vector2 scale) |
Creates a scaled matrix. More... | |
static Matrix3x3 | createSRT (Vector2 scale, float rotationInRadians, Vector2 translation) |
Create an SRT matrix. More... | |
static Matrix3x3 | createTranslation (Vector2 translation) |
Creates translation matrix. More... | |
static Matrix3x3 | createTranslation (float x, float y) |
Creates translation matrix. More... | |
Friends | |
Matrix3x3 | operator+ (Matrix3x3 lhs, const Matrix3x3 &rhs) |
Creates a new matrix by adding an existing matrix to another one. More... | |
Matrix3x3 | operator- (Matrix3x3 lhs, const Matrix3x3 &rhs) |
Creates a new matrix by subtracting an existing matrix from another one. More... | |
Matrix with 3x3 elements.
|
inlineexplicit |
Default constructor, initializes the matrix to identity matrix.
|
inlineexplicit |
Constructs the matrix from elements in column-major order.
|
inlineexplicit |
Constructs the matrix from three column vectors.
|
inline |
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. |
|
inline |
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. |
|
inline |
Gets the row of a matrix.
index | Index of the accessed row. |
|
inline |
Gets the column of a matrix.
index | Index of the accessed column. |
|
inline |
Sets the row of a matrix.
index | Index of the accessed row. |
row | The value to set to the row. |
|
inline |
Sets the column of a matrix.
index | Index of the accessed column. |
column | The value to set to the column. |
|
inline |
Get X axis.
|
inline |
Get Y axis.
|
inline |
Get X scale component.
|
inline |
Get Y scale component.
|
inline |
Get scale as a vector.
|
inline |
Scales this matrix.
v | Scaling vector. |
|
inline |
Translates this matrix.
v | Translation vector. |
|
inline |
Set X axis.
v | X axis vector. |
|
inline |
Set Y axis.
v | Y axis vector. |
|
inline |
Set translation.
translation | Translation vector. |
|
inline |
Set translation.
translationX | Translation X component. |
translationY | Translation Y component. |
|
inline |
Get translation.
|
inline |
Get translation on X axis.
|
inline |
Set translation on X axis.
translationX | Translation X component. |
|
inline |
Get translation on Y axis.
|
inline |
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. |
Creates translation matrix.
translation | Translation vector. |
|
inlinestatic |
Creates translation matrix.
x | X component of the Translation vector. |
y | Y component of the Translation vector. |
Creates a scaled matrix.
scale | Scaling vector. |
|
inlinestatic |
Creates identity matrix.
|
static |
Creates a rotation matrix.
angleInDegrees | Rotation angle in degrees. |
|
static |
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. |
|
inline |
Applies a transpose to a matrix.
Creates a new matrix by adding an existing matrix to another one.
lhs | First matrix, left hand side. |
rhs | Second matrix, right hand side. |
Creates a new matrix by subtracting an existing matrix from another one.
lhs | First matrix, left hand side. |
rhs | Second matrix, right hand side. |