@relu-interactives/spatial-ecs 0.2.10 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/{System-AV2_87Zr.d.cts → System-CHCucemW.d.cts} +24 -2
  2. package/dist/{System-AV2_87Zr.d.ts → System-CHCucemW.d.ts} +24 -2
  3. package/dist/{Video-D6mObK_5.d.ts → Video-ACTSfWjH.d.cts} +2 -2
  4. package/dist/{Video-Bn93p6XV.d.cts → Video-B9ZKmBIT.d.ts} +2 -2
  5. package/dist/{chunk-Y7KXYSPD.js → chunk-ON4E5E5O.js} +4 -4
  6. package/dist/{chunk-Y7KXYSPD.js.map → chunk-ON4E5E5O.js.map} +1 -1
  7. package/dist/{chunk-ODCWJHPS.js → chunk-PH43YHUT.js} +40 -4
  8. package/dist/chunk-PH43YHUT.js.map +1 -0
  9. package/dist/{chunk-AZR6SLQN.js → chunk-XPCVEXMY.js} +2 -2
  10. package/dist/{chunk-AZR6SLQN.js.map → chunk-XPCVEXMY.js.map} +1 -1
  11. package/dist/{chunk-LE6ARNYQ.js → chunk-ZCEMOTH4.js} +4 -4
  12. package/dist/{chunk-LE6ARNYQ.js.map → chunk-ZCEMOTH4.js.map} +1 -1
  13. package/dist/components/index.cjs.map +1 -1
  14. package/dist/components/index.d.cts +2 -2
  15. package/dist/components/index.d.ts +2 -2
  16. package/dist/components/index.js +1 -1
  17. package/dist/docs/api/Behaviour/classes/Behaviour.md +29 -29
  18. package/dist/docs/api/Component/classes/Component.md +3 -1
  19. package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
  20. package/dist/docs/api/components/classes/AudioComponent.md +19 -19
  21. package/dist/docs/api/components/classes/CameraComponent.md +14 -14
  22. package/dist/docs/api/components/classes/EntityType.md +4 -4
  23. package/dist/docs/api/components/classes/Environment.md +3 -3
  24. package/dist/docs/api/components/classes/ImageComponent.md +7 -7
  25. package/dist/docs/api/components/classes/ImageTarget.md +7 -7
  26. package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
  27. package/dist/docs/api/components/classes/InstanceSlotComponent.md +52 -0
  28. package/dist/docs/api/components/classes/InstancedMeshComponent.md +82 -0
  29. package/dist/docs/api/components/classes/LightComponent.md +6 -6
  30. package/dist/docs/api/components/classes/MaterialComponent.md +11 -11
  31. package/dist/docs/api/components/classes/MeshComponent.md +3 -3
  32. package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
  33. package/dist/docs/api/components/classes/ModelComponent.md +4 -4
  34. package/dist/docs/api/components/classes/Name.md +3 -3
  35. package/dist/docs/api/components/classes/Object3DRef.md +4 -4
  36. package/dist/docs/api/components/classes/ParentId.md +3 -3
  37. package/dist/docs/api/components/classes/PhysicsComponent.md +6 -6
  38. package/dist/docs/api/components/classes/Postprocessing.md +3 -3
  39. package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
  40. package/dist/docs/api/components/classes/Selectable.md +3 -3
  41. package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
  42. package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
  43. package/dist/docs/api/components/classes/TransformComponent.md +12 -12
  44. package/dist/docs/api/components/classes/VideoComponent.md +28 -28
  45. package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
  46. package/dist/docs/api/components/index.md +6 -0
  47. package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
  48. package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
  49. package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
  50. package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +1 -1
  51. package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
  52. package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
  53. package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
  54. package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
  55. package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
  56. package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
  57. package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
  58. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +7 -7
  59. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
  60. package/dist/docs/api/components/type-aliases/EnvironmentState.md +5 -5
  61. package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
  62. package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
  63. package/dist/docs/api/components/type-aliases/InstanceTransform.md +49 -0
  64. package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +15 -0
  65. package/dist/docs/api/components/type-aliases/LightValueState.md +11 -11
  66. package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
  67. package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
  68. package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
  69. package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
  70. package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
  71. package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
  72. package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
  73. package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
  74. package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
  75. package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
  76. package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
  77. package/dist/docs/api/components/type-aliases/ScriptEntry.md +9 -9
  78. package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
  79. package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
  80. package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
  81. package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
  82. package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
  83. package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
  84. package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
  85. package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +15 -0
  86. package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +15 -0
  87. package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
  88. package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
  89. package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
  90. package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
  91. package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
  92. package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
  93. package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
  94. package/dist/docs/api/index/classes/AudioSystem.md +4 -4
  95. package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
  96. package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +4 -4
  97. package/dist/docs/api/index/classes/InputSystem.md +33 -33
  98. package/dist/docs/api/index/classes/InstancedMeshSystem.md +62 -0
  99. package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
  100. package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
  101. package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
  102. package/dist/docs/api/index/classes/ObjectManagementSystem.md +39 -19
  103. package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
  104. package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
  105. package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +4 -4
  106. package/dist/docs/api/index/classes/RenderSystem.md +3 -3
  107. package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +4 -4
  108. package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
  109. package/dist/docs/api/index/classes/VideoSystem.md +4 -4
  110. package/dist/docs/api/index/classes/World.md +82 -82
  111. package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
  112. package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
  113. package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
  114. package/dist/docs/api/index/functions/createEntityTypeComponent.md +2 -2
  115. package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
  116. package/dist/docs/api/index/functions/createImageComponent.md +1 -1
  117. package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
  118. package/dist/docs/api/index/functions/createImageTargetComponent.md +1 -1
  119. package/dist/docs/api/index/functions/createInstanceSlotComponent.md +30 -0
  120. package/dist/docs/api/index/functions/createInstancedMeshComponent.md +36 -0
  121. package/dist/docs/api/index/functions/createLightComponent.md +1 -1
  122. package/dist/docs/api/index/functions/createMaterialComponent.md +1 -1
  123. package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
  124. package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
  125. package/dist/docs/api/index/functions/createModelComponent.md +1 -1
  126. package/dist/docs/api/index/functions/createNameComponent.md +1 -1
  127. package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
  128. package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
  129. package/dist/docs/api/index/functions/createPhysicsComponent.md +1 -1
  130. package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
  131. package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
  132. package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
  133. package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
  134. package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
  135. package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
  136. package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
  137. package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
  138. package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +1 -1
  139. package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
  140. package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
  141. package/dist/docs/api/index/index.md +3 -0
  142. package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
  143. package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
  144. package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
  145. package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
  146. package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +3 -2
  147. package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
  148. package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
  149. package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +3 -3
  150. package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
  151. package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
  152. package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
  153. package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
  154. package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
  155. package/dist/docs/api/typedoc-sidebar.json +1 -1
  156. package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
  157. package/dist/docs/api/types/type-aliases/CheckboxInput.md +1 -1
  158. package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
  159. package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
  160. package/dist/docs/api/types/type-aliases/ComponentKind.md +3 -1
  161. package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
  162. package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
  163. package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
  164. package/dist/docs/api/types/type-aliases/EcsEntityKind.md +4 -2
  165. package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
  166. package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
  167. package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
  168. package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
  169. package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
  170. package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
  171. package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
  172. package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
  173. package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
  174. package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
  175. package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
  176. package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
  177. package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
  178. package/dist/docs/guide/component-catalog.md +2 -0
  179. package/dist/docs/guide/components/animation.md +40 -1
  180. package/dist/docs/guide/components/instance-slot.md +102 -0
  181. package/dist/docs/guide/components/instanced-mesh.md +186 -0
  182. package/dist/docs/guide/spawning/audio.md +29 -7
  183. package/dist/docs/guide/spawning/index.md +4 -0
  184. package/dist/docs/guide/spawning/instanced-mesh.md +267 -0
  185. package/dist/docs/guide/systems/_sidebar.json +4 -0
  186. package/dist/docs/guide/systems/instanced-mesh-system.md +32 -0
  187. package/dist/docs/guide/systems/object-management-system.md +9 -0
  188. package/dist/factories/index.cjs.map +1 -1
  189. package/dist/factories/index.d.cts +2 -2
  190. package/dist/factories/index.d.ts +2 -2
  191. package/dist/factories/index.js +3 -3
  192. package/dist/{index-BO49V8aS.d.ts → index-B5JcGMJ5.d.ts} +2 -2
  193. package/dist/{index-B4-ABchF.d.cts → index-kx5O2mVU.d.cts} +2 -2
  194. package/dist/index.cjs +37 -1
  195. package/dist/index.cjs.map +1 -1
  196. package/dist/index.d.cts +5 -5
  197. package/dist/index.d.ts +5 -5
  198. package/dist/index.js +8 -8
  199. package/dist/systems/index.cjs +37 -1
  200. package/dist/systems/index.cjs.map +1 -1
  201. package/dist/systems/index.d.cts +2 -2
  202. package/dist/systems/index.d.ts +2 -2
  203. package/dist/systems/index.js +3 -3
  204. package/dist/types.d.cts +1 -1
  205. package/dist/types.d.ts +1 -1
  206. package/dist/worldSnapshotUtils.d.cts +1 -1
  207. package/dist/worldSnapshotUtils.d.ts +1 -1
  208. package/package.json +1 -1
  209. package/dist/chunk-ODCWJHPS.js.map +0 -1
@@ -13,7 +13,7 @@ type IntersectionResult = {
13
13
  };
14
14
  ```
15
15
 
16
- Defined in: [types.ts:151](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L151)
16
+ Defined in: [types.ts:155](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L155)
17
17
 
18
18
  Single hit returned by `World.raycast` / `World.raycastFrom`. Pairs the
19
19
  standard `THREE.Intersection` (`threeResult`) with the owning entity id
@@ -25,5 +25,5 @@ editor helper).
25
25
 
26
26
  | Property | Type | Description | Defined in |
27
27
  | ------ | ------ | ------ | ------ |
28
- | <a id="entityid"></a> `entityId` | [`EntityId`](EntityId.md) \| `null` | The entity that owns the hit object, or `null` if untracked. | [types.ts:153](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L153) |
29
- | <a id="threeresult"></a> `threeResult` | `THREE.Intersection` | The underlying three.js intersection record. | [types.ts:155](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L155) |
28
+ | <a id="entityid"></a> `entityId` | [`EntityId`](EntityId.md) \| `null` | The entity that owns the hit object, or `null` if untracked. | [types.ts:157](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L157) |
29
+ | <a id="threeresult"></a> `threeResult` | `THREE.Intersection` | The underlying three.js intersection record. | [types.ts:159](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L159) |
@@ -13,7 +13,7 @@ type ParentLookup = {
13
13
  };
14
14
  ```
15
15
 
16
- Defined in: [types.ts:128](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L128)
16
+ Defined in: [types.ts:132](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L132)
17
17
 
18
18
  Result of a parent lookup. `parent` is `null` for entities at the root or
19
19
  for entities without a [ParentId](../../components/classes/ParentId.md) component.
@@ -22,5 +22,5 @@ for entities without a [ParentId](../../components/classes/ParentId.md) componen
22
22
 
23
23
  | Property | Type | Description | Defined in |
24
24
  | ------ | ------ | ------ | ------ |
25
- | <a id="parentidcomponent"></a> `parentIdComponent` | [`ParentId`](../../components/classes/ParentId.md) \| `null` | The entity's `ParentId` component, or `null` if it has none. | [types.ts:130](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L130) |
26
- | <a id="parent"></a> `parent` | [`WorldEntityView`](WorldEntityView.md) \| `null` | The resolved parent entity view, or `null` if the entity is at the root. | [types.ts:132](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L132) |
25
+ | <a id="parentidcomponent"></a> `parentIdComponent` | [`ParentId`](../../components/classes/ParentId.md) \| `null` | The entity's `ParentId` component, or `null` if it has none. | [types.ts:134](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L134) |
26
+ | <a id="parent"></a> `parent` | [`WorldEntityView`](WorldEntityView.md) \| `null` | The resolved parent entity view, or `null` if the entity is at the root. | [types.ts:136](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L136) |
@@ -10,7 +10,7 @@
10
10
  type SelectionListener = (entityId) => void;
11
11
  ```
12
12
 
13
- Defined in: [types.ts:43](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L43)
13
+ Defined in: [types.ts:45](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L45)
14
14
 
15
15
  Callback invoked when the selected entity changes. `null` indicates a deselection.
16
16
 
@@ -15,13 +15,13 @@ type SliderInput = {
15
15
  };
16
16
  ```
17
17
 
18
- Defined in: [types.ts:53](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L53)
18
+ Defined in: [types.ts:55](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L55)
19
19
 
20
20
  ## Properties
21
21
 
22
22
  | Property | Type | Defined in |
23
23
  | ------ | ------ | ------ |
24
- | <a id="min"></a> `min` | `number` | [types.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L54) |
25
- | <a id="max"></a> `max` | `number` | [types.ts:55](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L55) |
26
- | <a id="step"></a> `step` | `number` | [types.ts:56](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L56) |
27
- | <a id="value"></a> `value` | `number` | [types.ts:57](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L57) |
24
+ | <a id="min"></a> `min` | `number` | [types.ts:56](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L56) |
25
+ | <a id="max"></a> `max` | `number` | [types.ts:57](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L57) |
26
+ | <a id="step"></a> `step` | `number` | [types.ts:58](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L58) |
27
+ | <a id="value"></a> `value` | `number` | [types.ts:59](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L59) |
@@ -10,4 +10,4 @@
10
10
  type TextInput = string;
11
11
  ```
12
12
 
13
- Defined in: [types.ts:48](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L48)
13
+ Defined in: [types.ts:50](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L50)
@@ -10,4 +10,4 @@
10
10
  type ToggleInput = boolean;
11
11
  ```
12
12
 
13
- Defined in: [types.ts:62](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L62)
13
+ Defined in: [types.ts:64](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L64)
@@ -16,7 +16,7 @@ type Vec3 =
16
16
  };
17
17
  ```
18
18
 
19
- Defined in: [types.ts:140](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L140)
19
+ Defined in: [types.ts:144](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L144)
20
20
 
21
21
  Loose 3D vector accepted by raycast and other spatial helpers. Either a
22
22
  live `THREE.Vector3` or a plain `{ x, y, z }` object — both are normalized
@@ -13,11 +13,11 @@ type Vector2Input = {
13
13
  };
14
14
  ```
15
15
 
16
- Defined in: [types.ts:51](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L51)
16
+ Defined in: [types.ts:53](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L53)
17
17
 
18
18
  ## Properties
19
19
 
20
20
  | Property | Type | Defined in |
21
21
  | ------ | ------ | ------ |
22
- | <a id="x"></a> `x` | `number` | [types.ts:51](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L51) |
23
- | <a id="y"></a> `y` | `number` | [types.ts:51](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L51) |
22
+ | <a id="x"></a> `x` | `number` | [types.ts:53](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L53) |
23
+ | <a id="y"></a> `y` | `number` | [types.ts:53](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L53) |
@@ -14,12 +14,12 @@ type Vector3Input = {
14
14
  };
15
15
  ```
16
16
 
17
- Defined in: [types.ts:52](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L52)
17
+ Defined in: [types.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L54)
18
18
 
19
19
  ## Properties
20
20
 
21
21
  | Property | Type | Defined in |
22
22
  | ------ | ------ | ------ |
23
- | <a id="x"></a> `x` | `number` | [types.ts:52](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L52) |
24
- | <a id="y"></a> `y` | `number` | [types.ts:52](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L52) |
25
- | <a id="z"></a> `z` | `number` | [types.ts:52](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L52) |
23
+ | <a id="x"></a> `x` | `number` | [types.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L54) |
24
+ | <a id="y"></a> `y` | `number` | [types.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L54) |
25
+ | <a id="z"></a> `z` | `number` | [types.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L54) |
@@ -10,7 +10,7 @@
10
10
  type WorldEntityView = NonNullable<ReturnType<World["getEntityById"]>>;
11
11
  ```
12
12
 
13
- Defined in: [types.ts:122](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/bdd9282dee928f9a7d192d992833af9bda98772b/core/types.ts#L122)
13
+ Defined in: [types.ts:126](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/7fc62aaeb41923795e50fda6e082908528d5abe6/core/types.ts#L126)
14
14
 
15
15
  Lightweight, read-only view of an entity returned by `World.getEntityById`.
16
16
  Contains the entity id and its current component list at the moment of the
@@ -27,6 +27,8 @@ Every entity in `@relu-interactives/spatial-ecs` is a bag of components. This ca
27
27
  - [Sprite](./components/sprite) — camera-facing billboard.
28
28
  - [Video](./components/video) — video texture with optional green-screen keying.
29
29
  - [Model](./components/model) — GLTF/GLB asset reference loaded asynchronously.
30
+ - [Instanced Mesh](./components/instanced-mesh) — groups instance-slot entities into a single GPU-instanced draw call for high-count identical objects.
31
+ - [Instance Slot](./components/instance-slot) — marks an entity as a single instance within an `InstancedMeshComponent` group.
30
32
 
31
33
  ## Lighting & atmosphere
32
34
 
@@ -109,9 +109,48 @@ export default class AnimationSpeedDriver extends Behaviour {
109
109
  ```
110
110
 
111
111
  ::: tip State machine
112
- Always use anim.switchState(name)` to change the active clip — do not assign to `active` directly. This ensures the animation system observes the transition and applies the configured cross-fade.
112
+ Always use `anim.switchState(name)` to change the active clip — do not assign to `active` directly. This ensures the animation system observes the transition and applies the configured cross-fade.
113
113
  :::
114
114
 
115
+ ### ⚠️ `addState` — positional args only (critical)
116
+
117
+ `addState` takes **three positional arguments**: `(name, clipRef, loop)`. Passing an object will silently resolve nothing because `resolveClipRef` won't find a clip named `[object Object]`.
118
+
119
+ ```typescript
120
+ // ✅ Correct — positional args
121
+ anim.addState("Walk", "Walk", true);
122
+ anim.addState("Attack", "Attack", false);
123
+
124
+ // ❌ Wrong — object arg; the clip will never resolve
125
+ anim.addState({ name: "Walk", clip: "Walk", loop: true }); // ← broken
126
+ ```
127
+
128
+ ### Typical deferred setup (model may not be loaded yet)
129
+
130
+ Guard on `availableClips.length > 0` inside `onUpdate` until the model is ready, then register states once:
131
+
132
+ ```typescript
133
+ import { Behaviour, AnimationComponent } from "@relu-interactives/spatial-ecs";
134
+
135
+ export default class AnimSetup extends Behaviour {
136
+ private ready = false;
137
+
138
+ protected onUpdate() {
139
+ if (this.ready) return;
140
+ const anim = this.getComponent(AnimationComponent);
141
+ if (!anim || anim.availableClips.length === 0) return;
142
+
143
+ const c = anim.availableClips;
144
+ if (c.includes("Walk")) anim.addState("Walk", "Walk", true);
145
+ if (c.includes("Run")) anim.addState("Run", "Run", true);
146
+ if (c.includes("Attack")) anim.addState("Attack", "Attack", false);
147
+ anim.crossFadeDuration = 0.25;
148
+ anim.switchState("Walk");
149
+ this.ready = true;
150
+ }
151
+ }
152
+ ```
153
+
115
154
  ### Via `ComponentInput` in the inspector
116
155
 
117
156
  You can also pick this component from the inspector using a `ComponentInput` field. Assign any entity in the inspector and the field resolves to the live `AnimationComponent` instance at runtime.
@@ -0,0 +1,102 @@
1
+ # Instance Slot
2
+
3
+ Marks an entity as a single instance within an [`InstancedMeshComponent`](./instanced-mesh) group. Instance slot entities are lightweight data containers — they carry a `TransformComponent` (the per-instance local transform) and this component, but do **not** have an `Object3DRef`. `InstancedMeshSystem` reads every slot's `TransformComponent` each frame to compose the instance matrix for that slot's index.
4
+
5
+ Slot entities appear in the hierarchy as children of their owning `instancedMesh` group entity. Removing a slot entity from the world (or removing its ID from `InstancedMeshComponent.instanceEntityIds`) retires that instance.
6
+
7
+ > **Used by:** [`InstancedMeshSystem`](../systems/instanced-mesh-system), [`InstancedMeshComponent`](./instanced-mesh)
8
+
9
+ ## Properties
10
+
11
+ | Property | Type | Description |
12
+ | --- | --- | --- |
13
+ | `groupEntityId` | `number` | Entity ID of the owning `InstancedMeshComponent` group entity. |
14
+ | `slotIndex` | `number` | Zero-based index of this slot within the group's `instanceEntityIds` array. Used by `InstancedMeshSystem` to write the correct column of the instance-matrix buffer. |
15
+
16
+ ## API reference
17
+
18
+ - Class: [`InstanceSlotComponent`](../../api/components/classes/InstanceSlotComponent.md)
19
+ - Source: [`core/components/InstanceSlotComponent.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/InstanceSlotComponent.ts)
20
+
21
+ ## Scripting examples
22
+
23
+ ::: tip Component access patterns
24
+ Use `this.getComponent(X)` to access a component on the **entity this script is attached to**. Use `this.world.getEntityByName` to find another entity by name, then `this.world.getComponent` to read its component:
25
+
26
+ ```typescript
27
+ // Component on the entity this script is on
28
+ const slot = this.getComponent(InstanceSlotComponent);
29
+
30
+ // Component on another entity
31
+ const other = this.world.getEntityByName("Instance 3");
32
+ if (other) {
33
+ const slot = this.world.getComponent(other.entityId, InstanceSlotComponent);
34
+ }
35
+ ```
36
+ :::
37
+
38
+ ### Find the group from a slot
39
+
40
+ ```typescript
41
+ import {
42
+ Behaviour,
43
+ InstanceSlotComponent,
44
+ InstancedMeshComponent,
45
+ } from "@relu-interactives/spatial-ecs";
46
+
47
+ export default class SlotInfo extends Behaviour {
48
+ protected init() {
49
+ const slot = this.getComponent(InstanceSlotComponent);
50
+ if (!slot) return;
51
+
52
+ const groupEntity = this.world.getEntityById(slot.groupEntityId);
53
+ if (!groupEntity) return;
54
+
55
+ const group = this.world.getComponent(slot.groupEntityId, InstancedMeshComponent);
56
+ console.log(
57
+ `This is slot #${slot.slotIndex} of a group with ${group?.instanceEntityIds.length} instances`,
58
+ );
59
+ }
60
+ }
61
+ ```
62
+
63
+ ### Accept a slot reference via ComponentInput
64
+
65
+ Use a `ComponentInput` field so the inspector can wire any instance slot entity to this script.
66
+
67
+ ```typescript
68
+ import {
69
+ Behaviour,
70
+ InstanceSlotComponent,
71
+ TransformComponent,
72
+ } from "@relu-interactives/spatial-ecs";
73
+ import type { ComponentInput, FloatInput } from "@relu-interactives/spatial-ecs";
74
+
75
+ export default class MoveSlot extends Behaviour {
76
+ data = {
77
+ targetSlot: {
78
+ type: "component",
79
+ componentKind: "InstanceSlot",
80
+ value: null,
81
+ } as unknown as ComponentInput<InstanceSlotComponent>,
82
+ offsetX: 1 as FloatInput,
83
+ };
84
+
85
+ protected init() {
86
+ const slot = this.data.targetSlot.value as InstanceSlotComponent | null;
87
+ if (!slot) return;
88
+
89
+ const transform = this.world.getComponentById(slot.groupEntityId, TransformComponent);
90
+ // Operate on the slot entity's own transform instead:
91
+ const slotEntity = this.world.getEntityById(
92
+ // find the slot entity ID from the group
93
+ (this.world.getComponent(slot.groupEntityId, { prototype: {} } as never) as never) ?? -1,
94
+ );
95
+ // Simpler: if this script is on the slot entity itself:
96
+ const ownTransform = this.getComponent(TransformComponent);
97
+ if (ownTransform) {
98
+ ownTransform.position.x += this.data.offsetX;
99
+ }
100
+ }
101
+ }
102
+ ```
@@ -0,0 +1,186 @@
1
+ # Instanced Mesh
2
+
3
+ Groups one or more instance-slot entities into a single GPU-instanced draw call. Each instance's transform comes from its corresponding `InstanceSlotComponent` entity; `InstancedMeshSystem` reads those transforms every frame and writes the instance matrices into the underlying `THREE.InstancedMesh`.
4
+
5
+ Use instanced meshes when you need tens, hundreds, or thousands of identical objects (trees, tiles, particles, projectiles, obstacles) without paying individual draw-call cost per object.
6
+
7
+ > **Managed by:** [`InstancedMeshSystem`](../systems/instanced-mesh-system)
8
+
9
+ ## Editor inspector
10
+
11
+ ![Instanced Mesh inspector](/images/components/instanced-mesh.png)
12
+
13
+ ## Properties
14
+
15
+ | Property | Type | Description |
16
+ | --- | --- | --- |
17
+ | `meshKind` | `InstancedMeshKind` | Geometry used for every instance. One of `"cube"`, `"sphere"`, `"plane"`, `"cylinder"`, `"capsule"`, `"model"`. |
18
+ | `modelPath` | `string` | Source URL or `localasset://` path of the GLTF/GLB asset. Only read when `meshKind === "model"`. |
19
+ | `meshParameters` | `MeshGeometryParameters` | Geometry dimensions (width/height/depth for box, radius/height for cylinder/capsule, radius for sphere, width/height for plane). Ignored when `meshKind === "model"`. |
20
+ | `castShadow` | `boolean` | Whether all instances cast shadows. |
21
+ | `receiveShadow` | `boolean` | Whether all instances receive shadows. |
22
+ | `instanceEntityIds` | `number[]` | Ordered list of entity IDs for the `InstanceSlotComponent` entities owned by this group. Each slot carries its own `TransformComponent`. |
23
+ | `instancedMesh` | `THREE.Object3D \| null` | Live runtime object managed by `InstancedMeshSystem`. `null` until the system builds the mesh. **Not serialized — do not persist or clone this field.** |
24
+
25
+ ## API reference
26
+
27
+ - Class: [`InstancedMeshComponent`](../../api/components/classes/InstancedMeshComponent.md)
28
+ - Source: [`core/components/InstancedMesh.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/InstancedMesh.ts)
29
+
30
+ ## Scripting examples
31
+
32
+ ::: tip Component access patterns
33
+ Use `this.getComponent(X)` to access a component on the **entity this script is attached to**. Use `this.world.getEntityByName` to find another entity by name, then `this.world.getComponent` to read its component:
34
+
35
+ ```typescript
36
+ // Component on the entity this script is on
37
+ const instanced = this.getComponent(InstancedMeshComponent);
38
+
39
+ // Component on another named entity
40
+ const other = this.world.getEntityByName("Tree Group");
41
+ if (other) {
42
+ const instanced = this.world.getComponent(other.entityId, InstancedMeshComponent);
43
+ }
44
+ ```
45
+ :::
46
+
47
+ ### Read instance count
48
+
49
+ ```typescript
50
+ import { Behaviour, InstancedMeshComponent } from "@relu-interactives/spatial-ecs";
51
+
52
+ export default class InstanceCounter extends Behaviour {
53
+ protected init() {
54
+ const instanced = this.getComponent(InstancedMeshComponent);
55
+ if (instanced) {
56
+ console.log(`This group has ${instanced.instanceEntityIds.length} instances`);
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ### Toggle shadows on all instances at runtime
63
+
64
+ ```typescript
65
+ import { Behaviour, InstancedMeshComponent } from "@relu-interactives/spatial-ecs";
66
+ import type { BooleanInput } from "@relu-interactives/spatial-ecs";
67
+
68
+ export default class ToggleShadows extends Behaviour {
69
+ data = {
70
+ castShadow: true as BooleanInput,
71
+ receiveShadow: true as BooleanInput,
72
+ };
73
+
74
+ protected init() {
75
+ const instanced = this.getComponent(InstancedMeshComponent);
76
+ if (!instanced) return;
77
+ instanced.castShadow = this.data.castShadow;
78
+ instanced.receiveShadow = this.data.receiveShadow;
79
+ }
80
+ }
81
+ ```
82
+
83
+ ### Animate every instance's Y position
84
+
85
+ Move each slot entity up and down using a sine wave. `InstancedMeshSystem` reads the `TransformComponent` of each slot every frame, so mutating the transform is all that is needed.
86
+
87
+ ```typescript
88
+ import {
89
+ Behaviour,
90
+ InstancedMeshComponent,
91
+ TransformComponent,
92
+ } from "@relu-interactives/spatial-ecs";
93
+
94
+ export default class WaveInstances extends Behaviour {
95
+ private elapsed = 0;
96
+
97
+ protected onUpdate() {
98
+ const instanced = this.getComponent(InstancedMeshComponent);
99
+ if (!instanced) return;
100
+
101
+ this.elapsed += this.deltaTime;
102
+
103
+ for (let i = 0; i < instanced.instanceEntityIds.length; i++) {
104
+ const slotId = instanced.instanceEntityIds[i];
105
+ const transform = this.world.getComponentById(slotId, TransformComponent);
106
+ if (transform) {
107
+ transform.position.y = Math.sin(this.elapsed + i * 0.5) * 2;
108
+ }
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ### Accept a group reference via ComponentInput
115
+
116
+ Use a `ComponentInput` field so the inspector can wire any `InstancedMeshComponent` entity to this script — useful when the script lives on a different entity than the group.
117
+
118
+ ```typescript
119
+ import {
120
+ Behaviour,
121
+ InstancedMeshComponent,
122
+ TransformComponent,
123
+ } from "@relu-interactives/spatial-ecs";
124
+ import type { ComponentInput } from "@relu-interactives/spatial-ecs";
125
+
126
+ export default class ScatterInstances extends Behaviour {
127
+ data = {
128
+ group: {
129
+ type: "component",
130
+ componentKind: "InstancedMesh",
131
+ value: null,
132
+ } as unknown as ComponentInput<InstancedMeshComponent>,
133
+ };
134
+
135
+ protected init() {
136
+ const instanced = this.data.group.value as InstancedMeshComponent | null;
137
+ if (!instanced) return;
138
+
139
+ // Scatter each instance randomly within a 10-unit area
140
+ for (const slotId of instanced.instanceEntityIds) {
141
+ const transform = this.world.getComponentById(slotId, TransformComponent);
142
+ if (transform) {
143
+ transform.position.x = (Math.random() - 0.5) * 10;
144
+ transform.position.z = (Math.random() - 0.5) * 10;
145
+ }
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ ### Spawn a new instance slot at runtime
152
+
153
+ Add a new slot entity to an existing group from a script. The new slot's transform is registered with the group and `InstancedMeshSystem` picks it up on the next frame.
154
+
155
+ ```typescript
156
+ import {
157
+ Behaviour,
158
+ InstancedMeshComponent,
159
+ } from "@relu-interactives/spatial-ecs";
160
+
161
+ export default class DynamicSpawner extends Behaviour {
162
+ protected init() {
163
+ const instanced = this.getComponent(InstancedMeshComponent);
164
+ if (!instanced) return;
165
+
166
+ const groupId = this.entityId;
167
+ const objects = this.world.getObjectManagementSystem();
168
+ objects?.requestCreate(
169
+ "instanceSlot",
170
+ {
171
+ name: `Instance ${instanced.instanceEntityIds.length + 1}`,
172
+ transform: { position: { x: 2, y: 0, z: 0 } },
173
+ options: {
174
+ groupEntityId: groupId,
175
+ slotIndex: instanced.instanceEntityIds.length,
176
+ },
177
+ },
178
+ (slotId) => {
179
+ instanced.instanceEntityIds.push(slotId);
180
+ },
181
+ );
182
+ }
183
+ }
184
+ ```
185
+
186
+ See the [Spawning Instanced Meshes](../spawning/instanced-mesh) guide for the full `requestCreate` API reference.
@@ -40,13 +40,35 @@ export default class SpawnSound extends Behaviour {
40
40
 
41
41
  ### `options`
42
42
 
43
- | Option | Type | Default | Description |
44
- | --------------- | -------------- | ------- | ------------------------------------------------ |
45
- | `autoplay` | `boolean` | `false` | Start playback as soon as the clip is loaded. |
46
- | `loop` | `boolean` | `false` | Loop playback indefinitely. |
47
- | `volume` | `number` (0–1) | `1` | Linear gain. |
48
- | `refDistance` | `number` | `1` | Distance at which volume is unattenuated. |
49
- | `rolloffFactor` | `number` | `1` | How quickly volume falls off past `refDistance`. |
43
+ | Option | Type | Default | Description |
44
+ | --------------- | ---------------------------------------- | ----------- | ----------------------------------------------------------------- |
45
+ | `autoplay` | `boolean` | `false` | Start playback as soon as the clip is loaded. |
46
+ | `loop` | `boolean` | `false` | Loop playback indefinitely. |
47
+ | `volume` | `number` (0–1) | `1` | Linear gain. |
48
+ | `pitch` | `number` | `1` | Playback rate multiplier (`1` = normal speed/pitch). |
49
+ | `positional` | `boolean` | `false` | When `true`, audio is spatialized using the entity's transform. |
50
+ | `refDistance` | `number` | `1` | Distance at which volume is unattenuated (positional only). |
51
+ | `distanceModel` | `"linear" \| "inverse" \| "exponential"` | `"inverse"` | WebAudio distance model (positional only). |
52
+ | `rolloffFactor` | `number` | `1` | How quickly volume falls off past `refDistance`. |
53
+
54
+ ## ⚠️ Common mistake — wrong payload shape
55
+
56
+ `path` and `options` must be **top-level** keys on the payload. Never nest them inside an `audio:` sub-object.
57
+
58
+ ```ts
59
+ // ✅ Correct
60
+ objects?.requestCreate("audio", {
61
+ name: "SFX",
62
+ path: "localasset://assets/sfx/hit.mp3",
63
+ options: { autoplay: true, volume: 0.8 },
64
+ });
65
+
66
+ // ❌ Wrong — do NOT wrap inside audio:{}
67
+ objects?.requestCreate("audio", {
68
+ name: "SFX",
69
+ audio: { path: "...", options: { autoplay: true } }, // ← this will be ignored
70
+ });
71
+ ```
50
72
 
51
73
  ## Components attached
52
74
 
@@ -57,6 +57,10 @@ Kind-specific fields go on `payload.path` (asset URL) or `payload.options` (type
57
57
  - [Cylinder](./cylinder)
58
58
  - [Empty](./empty)
59
59
 
60
+ ### Instanced Meshes
61
+
62
+ - [Instanced Mesh](./instanced-mesh) — GPU-instanced groups with dynamic slot management
63
+
60
64
  ### Media
61
65
 
62
66
  - [Model](./model)