Class: WasmMatrix
Defined in: src/components/matrix/WasmMatrix.ts:23
Bridge to the WebAssembly matrix module that batch-computes object world transforms. Holds the shared SRT/state buffers mapped onto the WASM heap and exposes setters used by Transform to feed per-object translation, rotation and scale into the native solver.
Constructors
Constructor
new WasmMatrix():
WasmMatrix
Returns
WasmMatrix
Properties
matrixBuffer
staticmatrixBuffer:FloatArray
Defined in: src/components/matrix/WasmMatrix.ts:26
World-matrix output buffer mapped onto the WASM heap.
matrixBuffer_32bit
staticmatrixBuffer_32bit:Float32Array
Defined in: src/components/matrix/WasmMatrix.ts:28
32-bit copy of the world matrices (used when running in double precision).
matrixSRTBuffer
staticmatrixSRTBuffer:FloatArray
Defined in: src/components/matrix/WasmMatrix.ts:30
Per-object scale/rotation/translation input buffer.
matrixContinuedSRTBuffer
staticmatrixContinuedSRTBuffer:FloatArray
Defined in: src/components/matrix/WasmMatrix.ts:32
Per-object continuous (per-frame delta) SRT buffer for animated transforms.
matrixWorldPositionHLBuffer
staticmatrixWorldPositionHLBuffer:Float32Array
Defined in: src/components/matrix/WasmMatrix.ts:34
High/low split of world positions for relative-to-eye (RTE) precision.
matrixStateBuffer
staticmatrixStateBuffer:Int32Array
Defined in: src/components/matrix/WasmMatrix.ts:36
Per-object state buffer (dirty flags, parent index, depth order).
matrixBufferPtr
staticmatrixBufferPtr:number
Defined in: src/components/matrix/WasmMatrix.ts:38
WASM heap pointer to the world-matrix buffer.
matrixSRTBufferPtr
staticmatrixSRTBufferPtr:number
Defined in: src/components/matrix/WasmMatrix.ts:40
WASM heap pointer to the SRT buffer.
matrixContinuedSRTBufferPtr
staticmatrixContinuedSRTBufferPtr:number
Defined in: src/components/matrix/WasmMatrix.ts:42
WASM heap pointer to the continuous SRT buffer.
matrixWorldPositionHLBufferPtr
staticmatrixWorldPositionHLBufferPtr:number
Defined in: src/components/matrix/WasmMatrix.ts:44
WASM heap pointer to the world-position high/low buffer.
matrixStateBufferPtr
staticmatrixStateBufferPtr:number
Defined in: src/components/matrix/WasmMatrix.ts:46
WASM heap pointer to the state buffer.
wasm
staticwasm: typeofModule
Defined in: src/components/matrix/WasmMatrix.ts:48
Loaded WASM matrix module instance.
stateStruct
staticstateStruct:number=4
Defined in: src/components/matrix/WasmMatrix.ts:50
Number of Int32 entries per object in the state buffer.
useDoublePrecision
staticuseDoublePrecision:boolean=false
Defined in: src/components/matrix/WasmMatrix.ts:52
Whether matrices are stored in 64-bit (double) precision.
Methods
init()
staticinit(count,useDoublePrecision?):Promise<void>
Defined in: src/components/matrix/WasmMatrix.ts:60
Load and initialize the WASM module, then allocate buffers for count matrices.
Parameters
count
number
maximum number of matrices to allocate
useDoublePrecision?
boolean = false
use 64-bit floats when true
Returns
Promise<void>
allocMatrix()
staticallocMatrix(count):void
Defined in: src/components/matrix/WasmMatrix.ts:72
Allocate the WASM-side matrix storage and map the shared buffers onto the WASM heap for count matrices.
Parameters
count
number
number of matrices to allocate
Returns
void
updateAllContinueTransform()
staticupdateAllContinueTransform(start,end,dt,RTEScale):void
Defined in: src/components/matrix/WasmMatrix.ts:113
Advance all continuous (auto-animating) transforms in the index range [start, end) by dt.
Parameters
start
number
first matrix index
end
number
one past the last matrix index
dt
number
delta time in seconds
RTEScale
number
relative-to-eye scale factor
Returns
void
setParent()
staticsetParent(matIndex,x,depthOrder):void
Defined in: src/components/matrix/WasmMatrix.ts:123
Set the parent index and depth order for a matrix.
Parameters
matIndex
number
matrix index to update
x
number
parent matrix index, or negative for no parent
depthOrder
number
hierarchy depth order used for update sequencing
Returns
void
setTranslate()
staticsetTranslate(matIndex,x,y,z):void
Defined in: src/components/matrix/WasmMatrix.ts:130
Set the local translation of a matrix.
Parameters
matIndex
number
x
number
y
number
z
number
Returns
void
setRotation()
staticsetRotation(matIndex,x,y,z):void
Defined in: src/components/matrix/WasmMatrix.ts:137
Set the local rotation of a matrix (Euler degrees).
Parameters
matIndex
number
x
number
y
number
z
number
Returns
void
setScale()
staticsetScale(matIndex,x,y,z):void
Defined in: src/components/matrix/WasmMatrix.ts:144
Set the local scale of a matrix.
Parameters
matIndex
number
x
number
y
number
z
number
Returns
void
setContinueTranslate()
staticsetContinueTranslate(matIndex,x,y,z):void
Defined in: src/components/matrix/WasmMatrix.ts:151
Set a per-frame continuous translation delta (auto-applied each update).
Parameters
matIndex
number
x
number
y
number
z
number
Returns
void
setContinueRotation()
staticsetContinueRotation(matIndex,x,y,z):void
Defined in: src/components/matrix/WasmMatrix.ts:161
Set a per-frame continuous rotation delta (auto-applied each update).
Parameters
matIndex
number
x
number
y
number
z
number
Returns
void
setContinueScale()
staticsetContinueScale(matIndex,x,y,z):void
Defined in: src/components/matrix/WasmMatrix.ts:171
Set a per-frame continuous scale delta (auto-applied each update).
Parameters
matIndex
number
x
number
y
number
z
number
Returns
void

