Matrix4
Overview
Matrix4 is a class in Aspose.3D FOSS for Typescript.
Matrix4.constructor creates a new 4x4 matrix, optionally from a 16‑element number array.
This class provides 17 methods for working with Matrix4 objects in Typescript programs.
Available methods include: concatenate, constructor, decompose, equals, getItem, identity, inverse, normalize, rotate, rotateFromEuler, scale, setItem, and 5 additional methods.
All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package.
Properties: determinant, m00, m01, m02, m03, m10, and 11 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
m00 | number | Read/Write | Gets the m00. |
m01 | number | Read/Write | Gets the m01. |
m02 | number | Read/Write | Gets the m02. |
m03 | number | Read/Write | Gets the m03. |
m10 | number | Read/Write | Gets the m10. |
m11 | number | Read/Write | Gets the m11. |
m12 | number | Read/Write | Gets the m12. |
m13 | number | Read/Write | Gets the m13. |
m20 | number | Read/Write | Gets the m20. |
m21 | number | Read/Write | Gets the m21. |
m22 | number | Read/Write | Gets the m22. |
m23 | number | Read/Write | Gets the m23. |
m30 | number | Read/Write | Gets the m30. |
m31 | number | Read/Write | Gets the m31. |
m32 | number | Read/Write | Gets the m32. |
m33 | number | Read/Write | Gets the m33. |
determinant | number | Read | Gets the determinant. |
Methods
| Signature | Description |
|---|---|
constructor() | Creates a new 4x4 matrix, optionally from a 16‑element number array |
constructor(matrix: number[]) | |
constructor() | |
constructor() | |
getItem(key: number) → number | Returns the matrix element at the given linear index |
setItem(key: number, value: number) | Sets the item value. |
transpose() → Matrix4 | Returns a new Matrix4 that is the transpose of this matrix |
concatenate(m2: Matrix4) → Matrix4 | |
normalize() → Matrix4 | Returns a new Matrix4 with uniform scaling removed (unit length axes) |
inverse() → Matrix4 | |
decompose(translation: any[], scaling: any[], rotation: any[]) | Extracts translation, scaling, and rotation into the supplied arrays |
setTRS(translation: any, rotation: any, scale: any) | Sets the trs value. |
toArray() → number[] | Returns the matrix elements as a 16‑length number array in row‑major order |
identity() → Matrix4 | Resets the matrix to the identity matrix and returns this instance |
translate(tx: number, ty: number, tz: number) → Matrix4 | Applies a translation by (tx,ty,tz) or a vector and returns this matrix |
translate(v: any) → Matrix4 | |
translate(tx: any, ty: any, tz: any) → Matrix4 | |
scale(sx: number, sy: number, sz: number) → Matrix4 | Applies scaling by (sx,sy,sz) or a vector and returns this matrix |
scale(v: any) → Matrix4 | |
scale(sx: any, sy: any, sz: any) → Matrix4 | |
rotateFromEuler(rx: number, ry: number, rz: number) → Matrix4 | |
rotateFromEuler(v: any) → Matrix4 | |
rotateFromEuler(rx: any, ry: any, rz: any) → Matrix4 | |
rotate(angle: number, axis: any) → Matrix4 | Creates a rotation matrix from an angle and axis or from a quaternion |
rotate(q: Quaternion) → Matrix4 | |
rotate(angle: any, axis: any) → Matrix4 | |
toString() → string | Returns a human‑readable string representation of the matrix values |
equals(other: Matrix4) → boolean | Compares this matrix with another for element‑wise equality |