Mirror Engine Logo
How To
Mirror Engine Logo

Class: Batch

Holds information about batched mesh instances. Created in BatchManager#create.

Constructors

new Batch()

new Batch(
   meshInstances: MeshInstance[],
   dynamic: boolean,
   batchGroupId: number): Batch

Create a new Batch instance.

Parameters

meshInstances

MeshInstance

The mesh instances to be batched.

dynamic

boolean

Whether this batch is dynamic (supports transforming mesh instances at runtime).

batchGroupId

number

Link this batch to a specific batch group. This is done automatically with default batches.

Returns

Batch

Properties

batchGroupId

batchGroupId: number

Link this batch to a specific batch group. This is done automatically with default batches.


dynamic

dynamic: boolean

Whether this batch is dynamic (supports transforming mesh instances at runtime).


meshInstance

meshInstance: MeshInstance = null

A single combined mesh instance, the result of batching.


origMeshInstances

origMeshInstances: MeshInstance[];

An array of original mesh instances, from which this batch was generated.

Methods

destroy()

destroy(scene: Scene, layers: number[]): void

Removes the batch from the layers and destroys it.

Parameters

scene

Scene

The scene.

layers

number

The layers to remove the batch from.

Returns

void