Matrix with 3x3 elements. More...
Public Member Functions | |
Matrix3x3 () | |
Default constructor, initializes the matrix to identity matrix. | |
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. | |
Matrix3x3 (Vector2 x, Vector2 y, Vector2 translation) | |
Constructs the matrix from three column vectors. | |
Matrix3x3 | add (Matrix3x3 m) |
Modifies this matrix by adding another matrix. | |
synchronized void | delete () |
boolean | equals (Object obj) |
Indicates whether some other object is "equal to" this one. | |
float | get (int index) |
Returns individual matrix element value at index. | |
Vector3 | getColumn (int index) |
Gets the column of a matrix. | |
float | getRotationAngle () |
Get rotation angle of the matrix. | |
Vector3 | getRow (int index) |
Gets the row of a matrix. | |
Vector2 | getScale () |
Get scale as a vector. | |
float | getScaleX () |
Get X scale component. | |
float | getScaleY () |
Get Y scale component. | |
Vector2 | getTranslation () |
Get translation. | |
float | getTranslationX () |
Get translation on X axis. | |
float | getTranslationY () |
Get translation on Y axis. | |
Vector2 | getXAxis () |
Get X axis. | |
Vector2 | getYAxis () |
Get Y axis. | |
int | hashCode () |
Returns a hash code value for the object. | |
Matrix3x3 | inverse () |
Applies an inversion to a matrix. | |
Matrix3x3 | inverseAffine () |
Applies an inversion to an affine matrix. | |
Matrix3x3 | multiply (Matrix3x3 m) |
Modifies this matrix by multiplying it with another matrix. | |
Matrix3x3 | normalized () |
Normalizes the input matrix. | |
void | scale (Vector2 v) |
Scales this matrix. | |
void | set (int index, float v) |
Sets the individual matrix element at index to value. | |
void | setColumn (int index, Vector3 column) |
Sets the column of a matrix. | |
void | setRow (int index, Vector3 row) |
Sets the row of a matrix. | |
void | setTranslation (float translationX, float translationY) |
Set translation. | |
void | setTranslation (Vector2 translation) |
Set translation. | |
void | setTranslationX (float translationX) |
Set translation on X axis. | |
void | setTranslationY (float translationY) |
Set translation on Y axis. | |
void | setXAxis (Vector2 v) |
Set X axis. | |
void | setYAxis (Vector2 v) |
Set Y axis. | |
Matrix3x3 | subtract (Matrix3x3 m) |
Modifies this matrix by subtracting another matrix from this matrix. | |
void | translate (Vector2 v) |
Translates this matrix. | |
Matrix3x3 | transposed () |
Applies a transpose to a matrix. | |
Static Public Member Functions | |
static Matrix3x3 | add (Matrix3x3 lhs, Matrix3x3 rhs) |
Creates a new matrix by adding an existing matrix to another one. | |
static Matrix3x3 | createFilled (float value) |
Creates a matrix with all elements set to value . | |
static Matrix3x3 | createIdentity () |
Creates identity matrix. | |
static Matrix3x3 | createRotationInDegrees (float angleInDegrees) |
Creates a rotation matrix. | |
static Matrix3x3 | createRotationInRadians (float angleInRadians) |
Creates a rotation matrix. | |
static Matrix3x3 | createScale (Vector2 scale) |
Creates a scaled matrix. | |
static Matrix3x3 | createSRT (Vector2 scale, float rotationInRadians, Vector2 translation) |
Create an SRT matrix. | |
static Matrix3x3 | createTranslation (float x, float y) |
Creates translation matrix. | |
static Matrix3x3 | createTranslation (Vector2 translation) |
Creates translation matrix. | |
static float | getDeterminant (Matrix3x3 matrix) |
Calculates the determinant of the matrix. | |
static float | getDeterminant2x2 (Matrix3x3 matrix) |
Calculates the determinant of the 2X2 part of a matrix. | |
static float | getTrace (Matrix3x3 matrix) |
Calculates the trace of a matrix. | |
static boolean | isScalingOnly (Matrix3x3 matrix) |
Determines whether a matrix is scaling-only. | |
static boolean | isTranslationOnly (Matrix3x3 matrix) |
Determines whether a matrix is translation-only. | |
static Vector2 | matrixMultiplyVectorBy2x2 (Matrix3x3 m, Vector2 v) |
Multiply a 2D vector with the top 2x2 part of a given matrix. | |
static Vector2 | multiply (Matrix3x3 m, Vector2 v) |
Multiplies matrix with a vector and returns the product. | |
static Vector3 | multiply (Matrix3x3 m, Vector3 v) |
Multiplies matrix with a vector and returns the product. | |
static Matrix3x3 | multiply (Matrix3x3 m1, Matrix3x3 m2) |
Multiplies two matrices and returns the product. | |
static Matrix3x3 | subtract (Matrix3x3 lhs, Matrix3x3 rhs) |
Creates a new matrix by subtracting an existing matrix from another one. | |
Protected Member Functions | |
void | finalize () |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | |
Protected Attributes | |
transient boolean | swigCMemOwn |
Does this object own its native object. | |
Matrix with 3x3 elements.
Creates a new matrix by adding an existing matrix to another one.
lhs | First matrix, left-hand side. |
rhs | Second matrix, right-hand side. |
Modifies this matrix by adding another matrix.
m | Another matrix. |
Creates a matrix with all elements set to value
.
value | Value to set to all elements. |
Creates a rotation matrix.
angleInDegrees | Rotation angle in degrees. |
Creates a rotation matrix.
angleInRadians | Rotation angle in radians. |
Creates a scaled matrix.
scale | Scaling vector. |
Create an SRT matrix.
scale | Scales by axises. |
rotationInRadians | Rotation component in radians. |
translation | Translation component. |
Creates translation matrix.
x | X component of the Translation vector. |
y | Y component of the Translation vector. |
Creates translation matrix.
translation | Translation vector. |
boolean equals | ( | Object | obj | ) |
Indicates whether some other object is "equal to" this one.
obj | The reference object with which to compare. |
|
protected |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
Finalization is deprecated and subject to removal in future.
Returns individual matrix element value at index.
Gets the column of a matrix.
index | Index of the accessed column. |
Calculates the determinant of the matrix.
matrix | The matrix for which you want to return the determinant. |
Calculates the determinant of the 2X2 part of a matrix.
matrix | The matrix for which you want to return the determinant. |
float getRotationAngle | ( | ) |
Get rotation angle of the matrix.
Gets the row of a matrix.
index | Index of the accessed row. |
Calculates the trace of a matrix.
Vector2 getTranslation | ( | ) |
Get translation.
float getTranslationX | ( | ) |
Get translation on X axis.
float getTranslationY | ( | ) |
Get translation on Y axis.
int hashCode | ( | ) |
Returns a hash code value for the object.
Matrix3x3 inverse | ( | ) |
Applies an inversion to a matrix.
Matrix3x3 inverseAffine | ( | ) |
Applies an inversion to an affine matrix.
Determines whether a matrix is scaling-only.
Note: This function allows translation.
matrix | Input matrix. |
Determines whether a matrix is translation-only.
matrix | Input matrix. |
Multiply a 2D vector with the top 2x2 part of a given matrix.
Modifies this matrix by multiplying it with another matrix.
m | Another matrix. |
Multiplies matrix with a vector and returns the product.
m | Left hand side matrix. |
v | Right hand side vector. |
Multiplies matrix with a vector and returns the product.
m | Left hand side matrix. |
v | Right hand side vector. |
Multiplies two matrices and returns the product.
m1 | Left-hand side matrix. |
m2 | Right-hand side matrix. |
Matrix3x3 normalized | ( | ) |
Normalizes the input matrix.
The matrix must be an affine transformation.
Sets the individual matrix element at index to value.
index | Matrix element index to set. |
Sets the column of a matrix.
index | Index of the accessed column. |
column | The value to set to the column. |
Sets the row of a matrix.
index | Index of the accessed row. |
row | The value to set to the row. |
Set translation.
translationX | Translation X component. |
translationY | Translation Y component. |
Set translation.
translation | Translation vector. |
Set translation on X axis.
translationX | Translation X component. |
Set translation on Y axis.
translationY | Translation Y component. |
Creates a new matrix by subtracting an existing matrix from another one.
lhs | First matrix, left hand side. |
rhs | Second matrix, right hand side. |
Modifies this matrix by subtracting another matrix from this matrix.
m | Another matrix. |
Matrix3x3 transposed | ( | ) |
Applies a transpose to a matrix.