AdvancedReadonlyoffsetFloat index of slot 0's matrix in data
ReadonlystrideFloats from one slot's matrix to the next in data
The float array holding every slot's matrix; it stays valid across unload(), but not past destroy()
Uploads the matrices written through data on the next render, for drawing, culling and shadows alike
Pass the range that changed, or nothing for every slot. Throws a RangeError for a range outside
the batch. The next render then uploads every matrix from slot 0 to the end of the range in one
go, so for a few scattered slots use setMatrixAt alone.
The first slot that changed
How many slots changed; defaults to every slot from first on
The slot matrices of a BatchedMesh3D as one float array, for rewriting many slots a frame
Slot
i's matrix is the 16 floats fromoffset + i * stride, column-major and affine, as setMatrixAt takes it. Call update once you're done, or the writes may never be uploaded:A new slot's matrix is all zeros, so set each full matrix once before writing only the lanes that move. Write only a slot's 16 floats: the floats between matrices hold engine data, such as the slot's material and visibility. Read
strideandoffsetrather than hard-coding them, since the layout can change between releases.