Creates a new MatrixStore.
The initial capacity of the matrix store (default is 10).
The dynamic buffer used to hold matrix data.
The raw floating-point data of all matrices.
Total number of matrices currently allocated in the store.
Allocates a new matrix and initializes it to the identity matrix.
The index of the newly allocated matrix.
Allocates a new matrix without initializing its elements.
The index of the newly allocated matrix.
Copies the elements from the source matrix to the destination matrix.
The index of the destination matrix.
The index of the source matrix.
Extracts the global position (translation) from the matrix at the given index.
The index of the matrix.
An object containing x and y global coordinates.
Extracts the global rotation (in radians) from the matrix at the given index.
The index of the matrix.
The global rotation in radians.
Extracts the global scale from the matrix at the given index.
The index of the matrix.
An object containing x and y global scale factors.
Sets the matrix at the given index to the identity matrix.
The index of the matrix to modify.
Inverts the matrix at the given index. If the matrix is not invertible, it defaults to the identity matrix.
The index of the matrix to invert.
Transforms a point from local coordinates to world coordinates.
The index of the local transformation matrix.
Local x coordinate.
Local y coordinate.
The transformed point in world coordinates.
Multiplies the destination matrix by the source matrix and stores the result in the destination.
The index of the destination matrix.
The index of the source matrix.
Multiplies matrix A by matrix B and stores the result in the output matrix.
The index of the output matrix.
The index of matrix A.
The index of matrix B.
Resets the store, clearing all allocated matrices.
Rotates the matrix at the given index by the specified radians.
The index of the matrix to modify.
The rotation angle in radians.
Rotates the matrix at the given index around a local offset point (pivot).
This is equivalent to:
(offsetX, offsetY) to move the pivot to the origin.radians.(-offsetX, -offsetY).Useful for rotating a sprite around a point other than its own origin, e.g. a character's limb rotating around its joint.
The index of the matrix to modify.
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.
Scales the matrix at the given index by scaleX and scaleY.
The index of the matrix to modify.
The scale factor along the x-axis.
The scale factor along the y-axis.
Converts the matrix at the given index to a CSS matrix string.
The index of the matrix.
A CSS matrix string.
Transforms a point by the matrix at the given index.
The index of the transformation matrix.
The x coordinate of the point.
The y coordinate of the point.
The transformed point {x, y}.
Translates the matrix at the given index by x and y.
The index of the matrix to modify.
The x translation.
The y translation.
Transforms a point from world coordinates to local coordinates using the matrix at the specified index. Useful for hit testing against objects placed in world space.
The index of the world transformation matrix.
World x coordinate.
World y coordinate.
The transformed point in local coordinates.
A highly optimized store for a collection of 2D 3x3 matrices (stored as 6 elements: a, b, c, d, tx, ty). Matrices are stored flat in a dynamic Float32Array to improve memory locality and cache performance.