class Matrix3


An immutable 3x3 matrix that represents rotation and scale. The matrix is column major and right handed. The indexes of dataToCopy represent the following matrix layout:

[0, 3, 6]
[
1, 4, 7]
[
2, 5, 8]

Summary

Public companion functions

Matrix3

Returns a new 3x3 rotation matrix from the given quaternion, which is first normalized.

Matrix3
fromScale(scale: Float)

Returns a new uniform scale matrix.

Matrix3

Returns a new scale matrix.

Public companion properties

Matrix3

Returns an identity matrix.

Matrix3

Returns a zero matrix.

Public constructors

Matrix3(dataToCopy: FloatArray)
Matrix3(other: Matrix3)

Creates a new matrix with a deep copy of the data from the other.

Public functions

Matrix3

Returns a copy of the matrix.

open operator Boolean
equals(other: Any?)

Returns true if this matrix is equal to other.

open Int

Standard hash code calculation using constructor values.

operator Matrix3
times(other: Matrix3)

Returns a new matrix with the matrix multiplication product of this matrix and the other matrix.

open String

Standard toString() implementation.

Public properties

FloatArray

Returns an array of the components of this matrix.

Matrix3

Returns a matrix that performs the opposite transformation.

Boolean

Returns true if this matrix is a valid transformation matrix that can be decomposed into rotation and scale using determinant properties.

Quaternion

Returns the rotation component of this matrix.

Vector3

Returns the scale component of this matrix.

Matrix3

Returns a matrix that is the transpose of this matrix.

Public companion functions

fromQuaternion

Added in 1.0.0-alpha05
fun fromQuaternion(quaternion: Quaternion): Matrix3

Returns a new 3x3 rotation matrix from the given quaternion, which is first normalized. This function uses a standard formula for the conversion, though alternative algebraic expressions exist due to differing conventions. The resulting matrix typically transforms 3D column vectors by pre-multiplication (e.g.,

$v'_{new} = M \cdot v_{old}$

).

fromScale

Added in 1.0.0-alpha05
fun fromScale(scale: Float): Matrix3

Returns a new uniform scale matrix.

fromScale

Added in 1.0.0-alpha05
fun fromScale(scale: Vector3): Matrix3

Returns a new scale matrix.

Public companion properties

IDENTITY

val IDENTITYMatrix3

Returns an identity matrix.

ZERO

val ZEROMatrix3

Returns a zero matrix.

Public constructors

Matrix3

Added in 1.0.0-alpha05
Matrix3(dataToCopy: FloatArray)
Parameters
dataToCopy: FloatArray

the array with 9 elements that will be copied over.

Matrix3

Added in 1.0.0-alpha05
Matrix3(other: Matrix3)

Creates a new matrix with a deep copy of the data from the other.

Public functions

copy

Added in 1.0.0-alpha05
fun copy(data: FloatArray = this.data): Matrix3

Returns a copy of the matrix.

equals

open operator fun equals(other: Any?): Boolean

Returns true if this matrix is equal to other.

hashCode

open fun hashCode(): Int

Standard hash code calculation using constructor values.

times

Added in 1.0.0-alpha05
operator fun times(other: Matrix3): Matrix3

Returns a new matrix with the matrix multiplication product of this matrix and the other matrix.

toString

open fun toString(): String

Standard toString() implementation.

Public properties

data

Added in 1.0.0-alpha05
val dataFloatArray

Returns an array of the components of this matrix.

inverse

Added in 1.0.0-alpha05
val inverseMatrix3

Returns a matrix that performs the opposite transformation.

isTrs

Added in 1.0.0-alpha05
val isTrsBoolean

Returns true if this matrix is a valid transformation matrix that can be decomposed into rotation and scale using determinant properties.

rotation

Added in 1.0.0-alpha05
val rotationQuaternion

Returns the rotation component of this matrix.

scale

Added in 1.0.0-alpha05
val scaleVector3

Returns the scale component of this matrix.

transpose

Added in 1.0.0-alpha05
val transposeMatrix3

Returns a matrix that is the transpose of this matrix.