The index of the current local matrix in the matrix store.
The index of the current world matrix in the matrix store.
The underlying store for matrices.
Internal stack maintaining structural information.
Optionalwidth: numberOptionalheight: numberOptionalcustomMatrix: numberOptionalworldMatrix: numberOptionallocalMatrix: numberOptionalscaleX: numberOptionalscaleY: numberOptionalrotation: numberOptionaloriginX: numberOptionaloriginY: numberOptionalwidth: numberOptionalheight: numberOptionaloffsetX: numberOptionaloffsetY: numberOptionalcustomMatrix: numberOptionalworldMatrix: numberOptionallocalMatrix: numberExtracts the global position (translation) from the current world matrix.
An object containing x and y global coordinates.
Extracts the global rotation (in radians) from the current world matrix.
The global rotation in radians.
Extracts the global scale from the current world matrix.
An object containing x and y global scale factors.
Returns the current world matrix as Float32Array [a, b, c, d, tx, ty].
Sets the current local and world matrices to the identity matrix.
Transforms a point from local coordinates to world coordinates. Uses the current world matrix to apply the transformation.
Local x coordinate.
Local y coordinate.
The transformed point in world coordinates.
Resets the entire stack state context, clearing matrices and step actions.
Restores the matrix state from the top of the stack. Equivalent to context.restore().
Removes a matrix from the frame recycle queue so
it remains valid across reset() calls.
Passing a MatrixSaveState retains its local and world matrices;
parent is not retained because it belongs to the parent stack state.
Retained matrices must eventually be released with matrix.free().
A matrix ID or the state returned by save().
The supplied ID or state, preserving its input type.
Rotates the current local and world matrices by the given radians.
The rotation angle in radians.
Rotates the current local and world matrices around a pivot point
that is offset from the matrix origin by (offsetX, offsetY).
This is a convenience wrapper around the common translate → rotate → translate-back pattern, avoiding manual coordinate juggling at the call site.
The rotation angle in radians.
The x component of the pivot point in local space.
The y component of the pivot point in local space.
Saves the current matrix state and pushes it onto the stack. Equivalent to context.save(). Provided matrix IDs are used directly and remain caller-owned; only matrices created by this call are queued for recycling by reset().
OptionalmatrixWorld: number | MatrixSaveStateOptional world matrix ID or saved state from this store; defaults to parent * local.
OptionalmatrixLocal: numberOptional local matrix ID from this store; defaults to identity.
Matrix IDs for the saved parent, local, and world transforms.
Scales the current local and world matrices by scaleX and scaleY.
Scaling factor along the x-axis.
Scaling factor along the y-axis.
Directly overwrites the current world matrix with the given 6-element 2D transform.
Translates the current local and world matrices by x and y.
Translation along the x-axis.
Translation along the y-axis.
Transforms a point from world coordinates to local coordinates. Useful for hit testing against objects placed in world space.
World x coordinate.
World y coordinate.
The transformed point in local coordinates.
A highly performant MatrixStack useful for hierarchal scene graphs. Handles both local and world transformations automatically.