Matrix4

Matrix4 class

4x4 matrix implementation.

Properties

NameDescription
m00The m00.
m01The m01.
m02The m02.
m03The m03.
m10The m10.
m11The m11.
m12The m12.
m13The m13.
m20The m20.
m21The m21.
m22The m22.
m23The m23.
m30The m30.
m31The m31.
m32The m32.
m33The m33.

Methods

constructor

NameDescription
constructor()

Result:


constructor_overload

NameDescription
constructor_overload(r0, r1, r2, r3)Constructs matrix from 4 rows.

Parameters:

NameTypeDescription
r0Vector4R0.
r1Vector4R1.
r2Vector4R2.
r3Vector4R3.

Result:


constructor_overload$2{#constructor_overload$2}

NameDescription
constructor_overload$2(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)Initializes a new instance of the Matrix4 struct.

Parameters:

NameTypeDescription
m00NumberM00.
m01NumberM01.
m02NumberM02.
m03NumberM03.
m10NumberM10.
m11NumberM11.
m12NumberM12.
m13NumberM13.
m20NumberM20.
m21NumberM21.
m22NumberM22.
m23NumberM23.
m30NumberM30.
m31NumberM31.
m32NumberM32.
m33NumberM33.

Result:


constructor_overload$3{#constructor_overload$3}

NameDescription
constructor_overload$3(m)Construct Matrix4 from an FMatrix4 instance

Parameters:

NameTypeDescription
FMatrix4null

Result:


constructor_overload$4{#constructor_overload$4}

NameDescription
constructor_overload$4(m)Initializes a new instance of the Matrix4 struct.

Parameters:

NameTypeDescription
mNumber[]M.

Result:


getIdentity

NameDescription
getIdentity()Gets the identity matrix. The identity.

Result:


getDeterminant

NameDescription
getDeterminant()Gets the determinant of the matrix. The determinant.

Result:


concatenate

NameDescription
concatenate(m2)Concatenates the two matrices

Parameters:

NameTypeDescription
m2Matrix4M2.

Result: Matrix4


transpose

NameDescription
transpose()Transposes this instance.

Result: Matrix4


normalize

NameDescription
normalize()Normalizes this instance.

Result: Matrix4


inverse

NameDescription
inverse()Inverses this instance.

Result: Matrix4


setTRS

NameDescription
setTRS(translation, rotation, scale)Initializes the matrix with translation/rotation/scale

Parameters:

NameTypeDescription
translationVector3Translation.
rotationVector3Euler angles for rotation, fields are in degree.
scaleVector3Scale.

Result: Matrix4


toArray

NameDescription
toArray()Converts matrix to array.

Result: Number[]


toString

NameDescription
toString()Returns a java.lang.String that represents the current Matrix4.

Result: String


translate

NameDescription
translate(t)Creates a matrix that translates along the x-axis, the y-axis and the z-axis

Parameters:

NameTypeDescription
tVector3Translate offset

Result: Matrix4


translate

NameDescription
translate(tx, ty, tz)Creates a matrix that translates along the x-axis, the y-axis and the z-axis

Parameters:

NameTypeDescription
txNumberX-coordinate offset
tyNumberY-coordinate offset
tzNumberZ-coordinate offset

Result: Matrix4


scale

NameDescription
scale(s)Creates a matrix that scales along the x-axis, the y-axis and the z-axis.

Parameters:

NameTypeDescription
sVector3Scaling factories applies to the x-axis, the y-axis and the z-axis

Result: Matrix4


scale

NameDescription
scale(s)Creates a matrix that scales along the x-axis, the y-axis and the z-axis.

Parameters:

NameTypeDescription
sNumberScaling factories applies to all axex

Result: Matrix4


scale

NameDescription
scale(sx, sy, sz)Creates a matrix that scales along the x-axis, the y-axis and the z-axis.

Parameters:

NameTypeDescription
sxNumberScaling factories applies to the x-axis
syNumberScaling factories applies to the y-axis
szNumberScaling factories applies to the z-axis

Result: Matrix4


rotateFromEuler

NameDescription
rotateFromEuler(eul)Create a rotation matrix from Euler angle

Parameters:

NameTypeDescription
eulVector3Rotation in radian

Result: Matrix4


rotateFromEuler

NameDescription
rotateFromEuler(rx, ry, rz)Create a rotation matrix from Euler angle

Parameters:

NameTypeDescription
rxNumberRotation in x axis in radian
ryNumberRotation in y axis in radian
rzNumberRotation in z axis in radian

Result: Matrix4


rotate

NameDescription
rotate(angle, axis)Create a rotation matrix by rotation angle and axis

Parameters:

NameTypeDescription
angleNumberRotate angle in radian
axisVector3Rotation axis

Result: Matrix4


rotate

NameDescription
rotate(q)Create a rotation matrix from a quaternion

Parameters:

NameTypeDescription
qQuaternionRotation quaternion

Result: Matrix4