@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / InstancedMeshSystem
Class: InstancedMeshSystem ​
Defined in: systems/InstancedMeshSystem.ts:161
Maintains the runtime geometry for entities with an InstancedMeshComponent.
- Primitive kinds (
cube,sphere,plane,cylinder,capsule): creates a singleTHREE.InstancedMeshon the anchor and writes per-instance matrices every frame. - Model kind (
model): asynchronously loads the GLTF/GLB atcomp.modelPath, traverses the scene to collect allTHREE.Meshnodes, and creates oneTHREE.InstancedMeshper mesh (preserving the mesh's local transform and original materials). All sub-meshes are grouped under aTHREE.Groupstored incomp.instancedMesh. Per-instance matrices are composed asinstanceTransform × meshLocalMatrixevery frame.
Geometry is rebuilt whenever the signature (meshKind:parameters:instanceCount for primitives, model:path:instanceCount for model kind) changes.
Implements ​
Constructors ​
Constructor ​
ts
new InstancedMeshSystem(): InstancedMeshSystem;Returns ​
InstancedMeshSystem
Properties ​
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
runsWhilePaused | readonly | true | true | Keep ticking while the world is paused. Leave it unset for anything that moves the game on: such a system stops at world.pause() and picks up where it was at world.resume(). | systems/InstancedMeshSystem.ts:162 |
Methods ​
update() ​
ts
update(world): void;Defined in: systems/InstancedMeshSystem.ts:180
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void

