Matrix4

Overview

Matrix4 is a class in Aspose.3D FOSS for Java. Inherits from: Struct<Matrix4>, Serializable.

Matrix4.Matrix4 creates a new identity matrix.

This class provides 36 methods and 2 properties for working with Matrix4 objects in Java. Available methods include: Matrix4, clone, concatenate, copyFrom, decompose, equals, getDeterminant, getIdentity, hashCode, inverse, mul, normalize, and additional methods. Properties: determinant, identity.

Description

Matrix4 is a class in the Aspose.3D FOSS library for Java that exposes 30 methods and 2 properties for programmatic use. It extends Struct<Matrix4> and implements Serializable, inheriting shared functionality from its parent type.

Core capabilities include: matrix4; double; sets the trs value. These operations enable developers to integrate matrix4 functionality directly into Java applications.

The class also provides the identity property (gets the identity), the determinant property (gets the determinant).

The class offers 6 constructor overloads, allowing flexible initialization depending on the calling context.

Properties

NameTypeAccessDescription
identityMatrix4ReadGets the identity.
determinantdoubleReadGets the determinant.

Methods

SignatureDescription
Matrix4()Creates a new identity matrix
Matrix4(m00: double, m01: double, m02: double, m03: double, m10: double, m11: double, m12: double, m13: double, m20: double, m21: double, m22: double, m23: double, m30: double, m31: double, m32: double, m33: double)Initializes matrix with the provided 16 double elements in row-major order
Matrix4(values: float[])Creates a matrix from a float array of 16 values
Matrix4(values: double[])Creates a matrix from a double array of 16 values
Matrix4(r0: Vector4, r1: Vector4, r2: Vector4, r3: Vector4)Builds a matrix from four Vector4 rows
getIdentity()Matrix4Returns the identity.
translate(v: Vector3)Matrix4Returns a matrix translated by the specified x, y, z offsets
translate(x: double, y: double, z: double)Matrix4Returns a matrix translated by the specified x, y, z double offsets
scale(v: Vector3)Matrix4Returns a matrix scaled by the components of the given Vector3
scale(s: double)Matrix4Returns a matrix uniformly scaled by the scalar s
scale(x: double, y: double, z: double)Matrix4Returns a matrix scaled by the specified x, y, z factors
rotate(angle: double, axis: Vector3)Matrix4Returns a matrix representing the rotation defined by the quaternion
rotate(q: Quaternion)Matrix4Returns a matrix rotated by angle around the given axis vector
rotateFromEuler(e: Vector3)Matrix4Returns a rotation matrix from the given Euler angles Vector3
rotateFromEuler(x: double, y: double, z: double)Matrix4Returns a rotation matrix from the given Euler angles x, y, z
mul(a: Matrix4, b: Matrix4)Matrix4Transforms Vector3 v by matrix m and returns the resulting Vector3
mul(m: Matrix4, s: double)Matrix4Returns matrix m scaled by scalar s
mul(m: Matrix4, v: Vector3)Vector3Transforms Vector3 v by matrix m and returns the resulting Vector3
mul(m: Matrix4, v: FVector3)FVector3Transforms FVector3 v by matrix m and returns the resulting FVector3
mul(m: Matrix4, v: Vector4)Vector4Transforms Vector4 v by matrix m and returns the resulting Vector4
mul(m: Matrix4, v: FVector4)FVector4Transforms FVector4 v by matrix m and returns the resulting FVector4
concatenate(m: Matrix4)Matrix4Multiplies this matrix by m and returns the result
transpose()Matrix4Returns the transpose of this matrix
getDeterminant()doubleReturns the determinant.
inverse()Matrix4Returns the inverse of this matrix
normalize()Matrix4Returns a matrix with normalized rows or columns
setTRS(translation: Vector3, rotation: Vector3, scale: Vector3)Sets the trs value.
setTRS(t: Vector3, r: Quaternion, s: Vector3)Sets the trs value.
decompose(scale: Vector3, rotation: Vector3, q: Quaternion)booleanDecomposes this matrix into scale, rotation Euler angles, and quaternion; returns true on success
toArray()double[]Returns the matrix elements as a double array in row-major order
toString()StringReturns a string representation of this matrix
clone()Matrix4Returns a copy of this matrix
Matrix4(other: Matrix4)Creates a copy of the given matrix
copyFrom(src: Matrix4)Copies the elements of src into this matrix
hashCode()intReturns the hash code of this matrix
equals(obj: Object)booleanReturns true if obj is a Matrix4 equal to this matrix

See Also