Skip to content

five-on-it / apps/client/src/renderer/models / Batch

Class: Batch ​

Defined in: apps/client/src/renderer/models.ts:546

One mesh drawn as thin instances: a matrix per instance, written every frame (the cracks on the glass are one too).

Constructors ​

Constructor ​

new Batch(mesh): Batch

Defined in: apps/client/src/renderer/models.ts:554

Makes mesh a batch: never picked, never culled, switched off until it has an instance.

Parameters ​

mesh ​

Mesh

Returns ​

Batch

Properties ​

mesh ​

readonly mesh: Mesh

Defined in: apps/client/src/renderer/models.ts:548

The mesh, its thin instances this frame's.

Methods ​

add() ​

add(world): void

Defined in: apps/client/src/renderer/models.ts:566

Adds an instance at world this frame.

Parameters ​

world ​

Matrix

Returns ​

void


flush() ​

flush(): number

Defined in: apps/client/src/renderer/models.ts:582

Shows this frame's instances and starts the next frame empty. The count never drops to zero (a mesh without thin instances is drawn another way, with another shader): an empty batch is switched off instead.

Returns ​

number