Kanzi  3.9.9
Kanzi Engine Java API
Matrix3x3 Class Reference

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. More...
 
synchronized void delete ()
 
boolean equals (Object obj)
 Indicates whether some other object is "equal to" this one. More...
 
float get (int index)
 Returns individual matrix element value at index. More...
 
Vector3 getColumn (int index)
 Gets the column of a matrix. More...
 
float getRotationAngle ()
 Get rotation angle of the matrix. More...
 
Vector3 getRow (int index)
 Gets the row of a matrix. More...
 
Vector2 getScale ()
 Get scale as a vector.
 
float getScaleX ()
 Get X scale component.
 
float getScaleY ()
 Get Y scale component.
 
Vector2 getTranslation ()
 Get translation. More...
 
float getTranslationX ()
 Get translation on X axis. More...
 
float getTranslationY ()
 Get translation on Y axis. More...
 
Vector2 getXAxis ()
 Get X axis.
 
Vector2 getYAxis ()
 Get Y axis.
 
int hashCode ()
 Returns a hash code value for the object. More...
 
Matrix3x3 inverse ()
 Applies an inversion to a matrix. More...
 
Matrix3x3 inverseAffine ()
 Applies an inversion to an affine matrix. More...
 
Matrix3x3 multiply (Matrix3x3 m)
 Modifies this matrix by multiplying it with another matrix. More...
 
Matrix3x3 normalized ()
 Normalizes the input matrix. More...
 
void scale (Vector2 v)
 Scales this matrix. More...
 
void set (int index, float v)
 Sets the individual matrix element at index to value. More...
 
void setColumn (int index, Vector3 column)
 Sets the column of a matrix. More...
 
void setRow (int index, 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...
 
Matrix3x3 subtract (Matrix3x3 m)
 Modifies this matrix by subtracting another matrix from this matrix. More...
 
void translate (Vector2 v)
 Translates this matrix. More...
 
Matrix3x3 transposed ()
 Applies a transpose to a matrix. More...
 

Static Public Member Functions

static Matrix3x3 add (Matrix3x3 lhs, Matrix3x3 rhs)
 Creates a new matrix by adding an existing matrix to another one. More...
 
static Matrix3x3 createFilled (float value)
 Creates a matrix with all elements set to value. More...
 
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...
 
static float getDeterminant (Matrix3x3 matrix)
 Calculates the determinant of the matrix. More...
 
static float getDeterminant2x2 (Matrix3x3 matrix)
 Calculates the determinant of the 2X2 part of a matrix. More...
 
static float getTrace (Matrix3x3 matrix)
 Calculates the trace of a matrix. More...
 
static boolean isScalingOnly (Matrix3x3 matrix)
 Determines whether a matrix is scaling-only. More...
 
static boolean isTranslationOnly (Matrix3x3 matrix)
 Determines whether a matrix is translation-only. More...
 
static Vector2 matrixMultiplyVectorBy2x2 (Matrix3x3 m, Vector2 v)
 Multiply a 2D vector with the top 2x2 part of a given matrix. More...
 
static Matrix3x3 multiply (Matrix3x3 m1, Matrix3x3 m2)
 Multiplies two matrices and returns the product. More...
 
static Vector3 multiply (Matrix3x3 m, Vector3 v)
 Multiplies matrix with a vector and returns the product. More...
 
static Vector2 multiply (Matrix3x3 m, Vector2 v)
 Multiplies matrix with a vector and returns the product. More...
 
static Matrix3x3 subtract (Matrix3x3 lhs, Matrix3x3 rhs)
 Creates a new matrix by subtracting an existing matrix from another one. More...
 

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. More...
 

Protected Attributes

transient boolean swigCMemOwn
 Does this object own its native object. More...
 

Detailed Description

Matrix with 3x3 elements.

Member Function Documentation

Matrix3x3 add ( Matrix3x3  m)

Modifies this matrix by adding another matrix.


Parameters
mAnother matrix.
Returns
This matrix.
static Matrix3x3 add ( Matrix3x3  lhs,
Matrix3x3  rhs 
)
static

Creates a new matrix by adding an existing matrix to another one.

Parameters
lhsFirst matrix, left-hand side.
rhsSecond matrix, right-hand side.
Returns
A new matrix resulting from the addition of the right hand side to the left hand side.
static Matrix3x3 createFilled ( float  value)
static

Creates a matrix with all elements set to value.


Parameters
valueValue to set to all elements.
Returns
The constructed matrix.
Since
Kanzi 3.9.9
static Matrix3x3 createIdentity ( )
static

Creates identity matrix.


Returns
Identity matrix.
static Matrix3x3 createRotationInDegrees ( float  angleInDegrees)
static

Creates a rotation matrix.


Parameters
angleInDegreesRotation angle in degrees.
Returns
Rotation matrix.
static Matrix3x3 createRotationInRadians ( float  angleInRadians)
static

Creates a rotation matrix.


Parameters
angleInRadiansRotation angle in radians.
Returns
Rotation matrix.
static Matrix3x3 createScale ( Vector2  scale)
static

Creates a scaled matrix.


Parameters
scaleScaling vector.
Returns
Scaled matrix.
static Matrix3x3 createSRT ( Vector2  scale,
float  rotationInRadians,
Vector2  translation 
)
static

Create an SRT matrix.


Parameters
scaleScales by axises.
rotationInRadiansRotation component in radians.
translationTranslation component.
Returns
Newly constructed matrix.
static Matrix3x3 createTranslation ( Vector2  translation)
static

Creates translation matrix.


Parameters
translationTranslation vector.
Returns
Translation matrix.
static Matrix3x3 createTranslation ( float  x,
float  y 
)
static

Creates translation matrix.


Parameters
xX component of the Translation vector.
yY component of the Translation vector.
Returns
Translation matrix.
boolean equals ( Object  obj)

Indicates whether some other object is "equal to" this one.

Parameters
objThe reference object with which to compare.
Returns
True if this object is the same as the obj argument, otherwise false.
void finalize ( )
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.

float get ( int  index)

Returns individual matrix element value at index.


Returns
The matrix element value at index.
Vector3 getColumn ( int  index)

Gets the column of a matrix.


Parameters
indexIndex of the accessed column.
Returns
The column.
static float getDeterminant ( Matrix3x3  matrix)
static

Calculates the determinant of the matrix.


Parameters
matrixThe matrix for which you want to return the determinant.
Returns
Determinant of the matrix.
static float getDeterminant2x2 ( Matrix3x3  matrix)
static

Calculates the determinant of the 2X2 part of a matrix.


Parameters
matrixThe matrix for which you want to return the determinant.
Returns
Determinant of the matrix.
float getRotationAngle ( )

Get rotation angle of the matrix.


Returns
Rotation angle of the matrix.
Vector3 getRow ( int  index)

Gets the row of a matrix.


Parameters
indexIndex of the accessed row.
Returns
The row.
static float getTrace ( Matrix3x3  matrix)
static

Calculates the trace of a matrix.


Returns
Trace of the matrix
Vector2 getTranslation ( )

Get translation.


Returns
Translation vector.
float getTranslationX ( )

Get translation on X axis.


Returns
Translation X component.
float getTranslationY ( )

Get translation on Y axis.


Returns
Translation Y component.
int hashCode ( )

Returns a hash code value for the object.

Returns
A hash code value for this object.
Matrix3x3 inverse ( )

Applies an inversion to a matrix.

Returns
Inverted matrix if the input matrix is invertible, null otherwise.
Matrix3x3 inverseAffine ( )

Applies an inversion to an affine matrix.

Returns
Inverted matrix if the input matrix is invertible, null otherwise.
static boolean isScalingOnly ( Matrix3x3  matrix)
static

Determines whether a matrix is scaling-only.


Note: This function allows translation.

Parameters
matrixInput matrix.
Returns
If the input matrix is scaling-only, true, otherwise false.
static boolean isTranslationOnly ( Matrix3x3  matrix)
static

Determines whether a matrix is translation-only.


Parameters
matrixInput matrix.
Returns
If the input matrix is translation-only, true, otherwise false.
static Vector2 matrixMultiplyVectorBy2x2 ( Matrix3x3  m,
Vector2  v 
)
static

Multiply a 2D vector with the top 2x2 part of a given matrix.


Returns
The result of the multiplication.
Matrix3x3 multiply ( Matrix3x3  m)

Modifies this matrix by multiplying it with another matrix.


Parameters
mAnother matrix.
Returns
This matrix.
static Matrix3x3 multiply ( Matrix3x3  m1,
Matrix3x3  m2 
)
static

Multiplies two matrices and returns the product.

Parameters
m1Left-hand side matrix.
m2Right-hand side matrix.
Returns
The result matrix.
static Vector3 multiply ( Matrix3x3  m,
Vector3  v 
)
static

Multiplies matrix with a vector and returns the product.

Parameters
mLeft hand side matrix.
vRight hand side vector.
Returns
The result vector.
static Vector2 multiply ( Matrix3x3  m,
Vector2  v 
)
static

Multiplies matrix with a vector and returns the product.

Parameters
mLeft hand side matrix.
vRight hand side vector.
Returns
The result vector.
Matrix3x3 normalized ( )

Normalizes the input matrix.

The matrix must be an affine transformation.

Returns
A normalized Matrix3x3. null if not affine transformation.
void scale ( Vector2  v)

Scales this matrix.


Parameters
vScaling vector.
void set ( int  index,
float  v 
)

Sets the individual matrix element at index to value.


Parameters
indexMatrix element index to set.
void setColumn ( int  index,
Vector3  column 
)

Sets the column of a matrix.


Parameters
indexIndex of the accessed column.
columnThe value to set to the column.
void setRow ( int  index,
Vector3  row 
)

Sets the row of a matrix.


Parameters
indexIndex of the accessed row.
rowThe value to set to the row.
void setTranslation ( Vector2  translation)

Set translation.


Parameters
translationTranslation vector.
void setTranslation ( float  translationX,
float  translationY 
)

Set translation.


Parameters
translationXTranslation X component.
translationYTranslation Y component.
void setTranslationX ( float  translationX)

Set translation on X axis.


Parameters
translationXTranslation X component.
void setTranslationY ( float  translationY)

Set translation on Y axis.


Parameters
translationYTranslation Y component.
void setXAxis ( Vector2  v)

Set X axis.


Parameters
vX axis vector.
void setYAxis ( Vector2  v)

Set Y axis.


Parameters
vY axis vector.
Matrix3x3 subtract ( Matrix3x3  m)

Modifies this matrix by subtracting another matrix from this matrix.


Parameters
mAnother matrix.
Returns
This matrix.
static Matrix3x3 subtract ( Matrix3x3  lhs,
Matrix3x3  rhs 
)
static

Creates a new matrix by subtracting an existing matrix from another one.

Parameters
lhsFirst matrix, left hand side.
rhsSecond matrix, right hand side.
Returns
A new matrix resulting from the subtraction of the right hand side to the left hand side.
void translate ( Vector2  v)

Translates this matrix.


Parameters
vTranslation vector.
Matrix3x3 transposed ( )

Applies a transpose to a matrix.


Returns
Newly constructed transpose matrix.

Member Data Documentation

transient boolean swigCMemOwn
protected

Does this object own its native object.