Abstract
Create a new instance.
Max size of a batch. Unit depends on batcher.
Object pool for batch entries
Object pool for batches
Changes to objects will be propagated to the change tracker
Protected
Readonly
_batchesReadonly
batchesBatches. All batches in this collection are at least partially occupied.
Protected
Readonly
batchObject pool for batches
Protected
Readonly
changeChanges to objects will be propagated to the change tracker
Protected
Readonly
entryObject pool for batch entries
Readonly
maxMax size of a batch. Unit depends on batcher.
Protected
Readonly
objectFor faster lookup of object -> batch.
Protected
Readonly
queuedNewly added entries are queued until all changes are applied to a batch.
Abstract
addProtected
addProtected
Abstract
addProtected
Abstract
canMark an object as changed. Changes are queued, apply with Batcher.finalize.
Changed object
Protected
Abstract
changeDelete an object and its entry. Deletes are queued, apply with Batcher.finalize.
Object to delete
true
if an entry was deleted
Finalize batches for this tick by applying all queued changes, adding all queued new entries, and cleaning up unused batches.
Finalized batches
Check if object
is part of this batcher.
Object
true
if batcher contains the object
Manages a collection of objects and distributes them into a set of batches, based on batcher-specific criteria (like size, number of textures, ...).
Remarks
A new batcher derived from Batcher must:
add
method. There is no default/overridableadd
method because the needs of a batcher can change it. This method should ultimately call Batcher.addEntryQueued.Implementing these allows for batching on many different criteria.
Depending on what is being batched and what the criteria for when a batch is 'full' are, derived versions of Batch and BatchEntry may be necessary.