Creates a new batch processor.
The number of batches currently stored in the BatchProcessor.
This callback is executed whenever a batch is finished and replaced by a new one. The finished MeshBatch is passed to the callback. Typically, this callback is used to actually render it.
Adds a mesh to the current batch, or to a new one if the current one does not support
it. Whenever the batch changes, onBatchComplete
is called for the previous
one.
@param mesh the mesh to add to the current (or new) batch.
@param state the render state from which to take the current settings for alpha,
modelview matrix, and blend mode.
@param subset the subset of the mesh you want to add, or null
for
the complete mesh.
@param ignoreTransformations when enabled, the mesh's vertices will be added
without transforming them in any way (no matter the value of the
state's modelviewMatrix
).
Clears all batches and adds them to a pool so they can be reused later.
Disposes all batches (including those in the reusable pool).
Sets all properties of the given token so that it describes the current position within this instance.
Finishes the current batch, i.e. call the 'onComplete' callback on the batch and prepares initialization of a new one.
Returns the batch at a certain index.
Disposes all batches that are currently unused.
Generated using TypeDoc
This class manages a list of mesh batches of different types; it acts as a "meta" MeshBatch that initiates all rendering.