Skip to main content

Class: InstancedEntityRoster

Owns a game's instanced entity pools: adds them to the scene, advances them every frame, bakes every variant during the load phase under a frame budget, and disposes them together.

The warmup is the point. Baking a variant the first time an entity of it appears converts one loading stall into a hitch every time something new walks into view, so the join flow awaits warm and the player is held out of the world until the whole roster is baked. Pools take part by implementing WarmablePool; a pool that does not is never warmed and should report its on-demand builds through noteLazyBake.

Hierarchy​

  • Group

    ↳ InstancedEntityRoster

Constructors​

constructor​

• new InstancedEntityRoster(): InstancedEntityRoster

Creates a new Group.

Returns​

InstancedEntityRoster

Inherited from​

THREE.Group.constructor

Accessors​

pools​

• get pools(): readonly RosterPool[]

Registered pools, in registration order.

Returns​

readonly RosterPool[]

Methods​

dispose​

▸ dispose(): void

Returns​

void


listShadowCasterPools​

▸ listShadowCasterPools(): Group<Object3DEventMap>[]

Every pool that is a group, for the shadow passes. Derived from the scene graph rather than listed by hand: a hand list once left three families out, so they only ever cast the bind-pose silhouette of the generic depth material.

Returns​

Group<Object3DEventMap>[]


readWarmupStats​

▸ readWarmupStats(): RosterWarmupStats

Returns​

RosterWarmupStats


register​

▸ register<T>(pool): T

Adds a pool whose update(deltaTime, renderer) advances it.

Type parameters​

NameType
Textends UpdatingRosterPool

Parameters​

NameType
poolT

Returns​

T

▸ register<T>(pool, update): T

Adds a pool advanced by update, or not per frame at all when null.

Type parameters​

NameType
Textends RosterPool

Parameters​

NameType
poolT
updateRosterUpdate

Returns​

T


update​

▸ update(deltaTime, renderer): void

Parameters​

NameType
deltaTimenumber
rendererWebGLRenderer

Returns​

void


warm​

▸ warm(options): Promise<void>

Bakes every variant of every warmable pool, a slice per frame, and resolves once the roster is complete. Calling it again returns the same promise. Neither it nor its hooks' absence ever rejects on its own.

Parameters​

NameType
optionsRosterWarmupOptions

Returns​

Promise<void>