Creates a new Transform3D instance.
Gets a copy of the rotation as Euler angles (XYZ order).
A cloned Vector3 containing rotation angles in radians [x, y, z]
Sets the rotation using Euler angles (XYZ order).
Vector containing rotation angles in radians [x, y, z]
Gets a copy of the local transformation matrix.
A new Matrix44 representing the composed transformation
Sets the transform from a 4x4 transformation matrix. Decomposes the matrix into position, rotation, and scale components.
The transformation matrix to decompose
Gets the local transformation matrix composed from position, rotation, and scale. The matrix is computed as: Translation * Rotation * Scale
A MutableMatrix44 representing the composed transformation
Gets a copy of the local position vector.
A cloned MutableVector3 representing the position
Sets the position of the transform.
The new position vector
Gets the internal position vector (direct reference).
The internal MutableVector3 position object
Gets the rotation as a 4x4 rotation matrix.
A Matrix44 representing only the rotation component
Sets the rotation using a 4x4 rotation matrix.
The rotation matrix to extract rotation from
Gets a copy of the local rotation quaternion.
A cloned Quaternion representing the rotation
Sets the rotation using a quaternion.
The new rotation quaternion
Gets the internal rotation quaternion (direct reference).
The internal Quaternion rotation object
Gets the internal scale vector (direct reference).
The internal MutableVector3 scale object
Gets the number of times this transform has been updated. This can be useful for optimization and caching purposes.
The update count as a number
Creates a deep copy of this transform.
A new Transform3D instance with the same values
Efficiently computes the transformation matrix and stores it in the provided matrix. This method avoids memory allocation by reusing an existing matrix object.
The target matrix to store the result in
Checks if this transform is equal to another transform within a given tolerance.
The transform to compare against
The tolerance for comparison (default: Number.EPSILON)
True if the transforms are equal within the specified tolerance
Sets the position using an array of three numbers.
Array containing [x, y, z] position values
Sets the rotation using an array of four numbers representing a quaternion.
Array containing [x, y, z, w] quaternion values
Sets the scale using an array of three numbers.
Array containing [x, y, z] scale values
Sets multiple transform components at once for optimal performance. This method reduces the cost of automatically updating transform matrices by setting all components in a single operation. Useful for animation and batch updates where performance is critical.
Note: The provided transform components must be mutually consistent. For example, if a matrix is provided, its decomposed translate, rotate, and scale components should match the individual component arguments.
The position component
The scale component
The rotation component as a quaternion
Represents a 3D transformation containing position, rotation, and scale components. This class provides a convenient way to handle 3D object transformations with automatic matrix composition and decomposition capabilities.
Example