Class SizedBatcher<O, S>

Batcher that batches only on a size criterium. The unit of the size can be anything (vertices, line segments, glyphs, ...).

Type Parameters

Hierarchy (View Summary)

Constructors

Properties

_batches: Batch<O, BatchEntry<O>, S>[] = []
batches: readonly Batch<O, BatchEntry<O>, S>[] = ...

Batches. All batches in this collection are at least partially occupied.

batchPool: Pool<Batch<O, BatchEntry<O>, S>>

Object pool for batches

changeTracker: ChangeTracker

Changes to objects will be propagated to the change tracker

entryPool: Pool<BatchEntry<O>>

Object pool for batch entries

maxSize: number

Max size of a batch. Unit depends on batcher.

objectBatches: Map<O, Batch<O, BatchEntry<O>, S>> = ...

For faster lookup of object -> batch.

queuedAdds: BatchEntry<O>[] = []

Newly added entries are queued until all changes are applied to a batch.

Methods