@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / InstancedMeshSystem
Class: InstancedMeshSystem
Defined in: systems/InstancedMeshSystem.ts:128
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
Methods
update()
ts
update(world): void;Defined in: systems/InstancedMeshSystem.ts:146
Parameters
| Parameter | Type |
|---|---|
world | World |
Returns
void

