@relu-interactives/spatial-ecs 0.2.2

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 (308) hide show
  1. package/README.md +125 -0
  2. package/dist/System-rXAmagXA.d.cts +659 -0
  3. package/dist/System-rXAmagXA.d.ts +659 -0
  4. package/dist/Video-CDemv74U.d.cts +1261 -0
  5. package/dist/Video-ChKV1UI7.d.ts +1261 -0
  6. package/dist/assets/draco/draco_decoder.js +34 -0
  7. package/dist/assets/draco/draco_decoder.wasm +0 -0
  8. package/dist/assets/draco/draco_wasm_wrapper.js +117 -0
  9. package/dist/chunk-AYEF3X2P.js +223 -0
  10. package/dist/chunk-AYEF3X2P.js.map +1 -0
  11. package/dist/chunk-MAWBTMCG.js +1722 -0
  12. package/dist/chunk-MAWBTMCG.js.map +1 -0
  13. package/dist/chunk-NFDTIYR4.js +248 -0
  14. package/dist/chunk-NFDTIYR4.js.map +1 -0
  15. package/dist/chunk-OY7ZODZP.js +16 -0
  16. package/dist/chunk-OY7ZODZP.js.map +1 -0
  17. package/dist/chunk-P2YDX5DB.js +3304 -0
  18. package/dist/chunk-P2YDX5DB.js.map +1 -0
  19. package/dist/chunk-QHILSPT4.js +3 -0
  20. package/dist/chunk-QHILSPT4.js.map +1 -0
  21. package/dist/chunk-XWIEEJ7Z.js +1315 -0
  22. package/dist/chunk-XWIEEJ7Z.js.map +1 -0
  23. package/dist/components/index.cjs +1745 -0
  24. package/dist/components/index.cjs.map +1 -0
  25. package/dist/components/index.d.cts +4 -0
  26. package/dist/components/index.d.ts +4 -0
  27. package/dist/components/index.js +4 -0
  28. package/dist/components/index.js.map +1 -0
  29. package/dist/docs/api/Behaviour/classes/Behaviour.md +554 -0
  30. package/dist/docs/api/Behaviour/index.md +15 -0
  31. package/dist/docs/api/Component/classes/Component.md +57 -0
  32. package/dist/docs/api/Component/index.md +15 -0
  33. package/dist/docs/api/components/classes/AnimationComponent.md +318 -0
  34. package/dist/docs/api/components/classes/AudioComponent.md +114 -0
  35. package/dist/docs/api/components/classes/CameraComponent.md +59 -0
  36. package/dist/docs/api/components/classes/EntityType.md +48 -0
  37. package/dist/docs/api/components/classes/Environment.md +47 -0
  38. package/dist/docs/api/components/classes/ImageComponent.md +57 -0
  39. package/dist/docs/api/components/classes/ImageTarget.md +60 -0
  40. package/dist/docs/api/components/classes/ImageTargetAnchor.md +48 -0
  41. package/dist/docs/api/components/classes/LightComponent.md +70 -0
  42. package/dist/docs/api/components/classes/MaterialComponent.md +181 -0
  43. package/dist/docs/api/components/classes/MeshComponent.md +48 -0
  44. package/dist/docs/api/components/classes/MeshGeometryComponent.md +64 -0
  45. package/dist/docs/api/components/classes/ModelComponent.md +49 -0
  46. package/dist/docs/api/components/classes/Name.md +46 -0
  47. package/dist/docs/api/components/classes/Object3DRef.md +54 -0
  48. package/dist/docs/api/components/classes/ParentId.md +47 -0
  49. package/dist/docs/api/components/classes/PhysicsComponent.md +82 -0
  50. package/dist/docs/api/components/classes/Postprocessing.md +49 -0
  51. package/dist/docs/api/components/classes/ScriptComponent.md +54 -0
  52. package/dist/docs/api/components/classes/Selectable.md +46 -0
  53. package/dist/docs/api/components/classes/SelectionTransformState.md +54 -0
  54. package/dist/docs/api/components/classes/SpriteComponent.md +55 -0
  55. package/dist/docs/api/components/classes/TransformComponent.md +197 -0
  56. package/dist/docs/api/components/classes/VideoComponent.md +123 -0
  57. package/dist/docs/api/components/functions/normalizePhysicsState.md +23 -0
  58. package/dist/docs/api/components/index.md +94 -0
  59. package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +42 -0
  60. package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +45 -0
  61. package/dist/docs/api/components/type-aliases/CameraProjection.md +15 -0
  62. package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +15 -0
  63. package/dist/docs/api/components/type-aliases/ColliderShape.md +15 -0
  64. package/dist/docs/api/components/type-aliases/ColliderState.md +62 -0
  65. package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +27 -0
  66. package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +15 -0
  67. package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +37 -0
  68. package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +15 -0
  69. package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +15 -0
  70. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +34 -0
  71. package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +15 -0
  72. package/dist/docs/api/components/type-aliases/EnvironmentState.md +29 -0
  73. package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +25 -0
  74. package/dist/docs/api/components/type-aliases/ImageTargetReference.md +33 -0
  75. package/dist/docs/api/components/type-aliases/LightValueState.md +41 -0
  76. package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +15 -0
  77. package/dist/docs/api/components/type-aliases/MaterialValueState.md +75 -0
  78. package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +13 -0
  79. package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +33 -0
  80. package/dist/docs/api/components/type-aliases/PhysicsState.md +25 -0
  81. package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +25 -0
  82. package/dist/docs/api/components/type-aliases/PostprocessingState.md +164 -0
  83. package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +25 -0
  84. package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +23 -0
  85. package/dist/docs/api/components/type-aliases/RigidbodyState.md +53 -0
  86. package/dist/docs/api/components/type-aliases/RigidbodyType.md +19 -0
  87. package/dist/docs/api/components/type-aliases/ScriptEntry.md +38 -0
  88. package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +15 -0
  89. package/dist/docs/api/components/type-aliases/TransformData.md +27 -0
  90. package/dist/docs/api/components/type-aliases/TransformModeValue.md +15 -0
  91. package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +15 -0
  92. package/dist/docs/api/components/type-aliases/Vec3.md +27 -0
  93. package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +13 -0
  94. package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +13 -0
  95. package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +13 -0
  96. package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +13 -0
  97. package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +13 -0
  98. package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +13 -0
  99. package/dist/docs/api/index/classes/AnimationStateMachine.md +201 -0
  100. package/dist/docs/api/index/classes/AnimationStateManager.md +253 -0
  101. package/dist/docs/api/index/classes/AnimationSystem.md +68 -0
  102. package/dist/docs/api/index/classes/AudioSystem.md +98 -0
  103. package/dist/docs/api/index/classes/CameraSyncSystem.md +49 -0
  104. package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +75 -0
  105. package/dist/docs/api/index/classes/InputSystem.md +449 -0
  106. package/dist/docs/api/index/classes/LightSyncSystem.md +49 -0
  107. package/dist/docs/api/index/classes/MaterialSyncSystem.md +67 -0
  108. package/dist/docs/api/index/classes/MeshGeometrySystem.md +49 -0
  109. package/dist/docs/api/index/classes/ObjectManagementSystem.md +298 -0
  110. package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +49 -0
  111. package/dist/docs/api/index/classes/PhysicsSyncSystem.md +83 -0
  112. package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +80 -0
  113. package/dist/docs/api/index/classes/RenderSystem.md +64 -0
  114. package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +83 -0
  115. package/dist/docs/api/index/classes/TransformSyncSystem.md +49 -0
  116. package/dist/docs/api/index/classes/VideoSystem.md +97 -0
  117. package/dist/docs/api/index/classes/World.md +1405 -0
  118. package/dist/docs/api/index/functions/createAnimationComponent.md +28 -0
  119. package/dist/docs/api/index/functions/createAudioComponent.md +32 -0
  120. package/dist/docs/api/index/functions/createCameraComponent.md +28 -0
  121. package/dist/docs/api/index/functions/createEntityTypeComponent.md +28 -0
  122. package/dist/docs/api/index/functions/createEnvironmentComponent.md +28 -0
  123. package/dist/docs/api/index/functions/createImageComponent.md +28 -0
  124. package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +28 -0
  125. package/dist/docs/api/index/functions/createImageTargetComponent.md +28 -0
  126. package/dist/docs/api/index/functions/createLightComponent.md +28 -0
  127. package/dist/docs/api/index/functions/createMaterialComponent.md +28 -0
  128. package/dist/docs/api/index/functions/createMeshComponent.md +28 -0
  129. package/dist/docs/api/index/functions/createMeshGeometryComponent.md +28 -0
  130. package/dist/docs/api/index/functions/createModelComponent.md +28 -0
  131. package/dist/docs/api/index/functions/createNameComponent.md +28 -0
  132. package/dist/docs/api/index/functions/createObject3DRefComponent.md +28 -0
  133. package/dist/docs/api/index/functions/createParentIdComponent.md +28 -0
  134. package/dist/docs/api/index/functions/createPhysicsComponent.md +30 -0
  135. package/dist/docs/api/index/functions/createPostprocessingComponent.md +28 -0
  136. package/dist/docs/api/index/functions/createScriptComponent.md +28 -0
  137. package/dist/docs/api/index/functions/createSelectableComponent.md +28 -0
  138. package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +28 -0
  139. package/dist/docs/api/index/functions/createSpriteComponent.md +28 -0
  140. package/dist/docs/api/index/functions/createTransformComponent.md +28 -0
  141. package/dist/docs/api/index/functions/createVideoComponent.md +28 -0
  142. package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +28 -0
  143. package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +28 -0
  144. package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +23 -0
  145. package/dist/docs/api/index/functions/registerDefaultFactories.md +23 -0
  146. package/dist/docs/api/index/index.md +249 -0
  147. package/dist/docs/api/index/interfaces/EcsSystem.md +50 -0
  148. package/dist/docs/api/index/interfaces/StateMachine.md +26 -0
  149. package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +25 -0
  150. package/dist/docs/api/index/type-aliases/ComponentFactory.md +25 -0
  151. package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +37 -0
  152. package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +26 -0
  153. package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +25 -0
  154. package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +23 -0
  155. package/dist/docs/api/index/type-aliases/KeyboardKey.md +13 -0
  156. package/dist/docs/api/index/type-aliases/MouseButton.md +13 -0
  157. package/dist/docs/api/index/type-aliases/SelectionContext.md +31 -0
  158. package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +13 -0
  159. package/dist/docs/api/index/variables/KeyboardKeys.md +195 -0
  160. package/dist/docs/api/index.md +15 -0
  161. package/dist/docs/api/typedoc-sidebar.json +1 -0
  162. package/dist/docs/api/types/index.md +34 -0
  163. package/dist/docs/api/types/type-aliases/AssetInput.md +23 -0
  164. package/dist/docs/api/types/type-aliases/CheckboxInput.md +13 -0
  165. package/dist/docs/api/types/type-aliases/ColorInput.md +13 -0
  166. package/dist/docs/api/types/type-aliases/ComponentInput.md +52 -0
  167. package/dist/docs/api/types/type-aliases/ComponentKind.md +37 -0
  168. package/dist/docs/api/types/type-aliases/DropdownInput.md +23 -0
  169. package/dist/docs/api/types/type-aliases/DropdownOption.md +23 -0
  170. package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +15 -0
  171. package/dist/docs/api/types/type-aliases/EcsEntityKind.md +35 -0
  172. package/dist/docs/api/types/type-aliases/EntityId.md +16 -0
  173. package/dist/docs/api/types/type-aliases/EntityInput.md +23 -0
  174. package/dist/docs/api/types/type-aliases/FloatInput.md +13 -0
  175. package/dist/docs/api/types/type-aliases/IntersectionResult.md +29 -0
  176. package/dist/docs/api/types/type-aliases/ParentLookup.md +26 -0
  177. package/dist/docs/api/types/type-aliases/SelectionListener.md +25 -0
  178. package/dist/docs/api/types/type-aliases/SliderInput.md +27 -0
  179. package/dist/docs/api/types/type-aliases/TextInput.md +13 -0
  180. package/dist/docs/api/types/type-aliases/ToggleInput.md +13 -0
  181. package/dist/docs/api/types/type-aliases/Vec3.md +23 -0
  182. package/dist/docs/api/types/type-aliases/Vector2Input.md +23 -0
  183. package/dist/docs/api/types/type-aliases/Vector3Input.md +25 -0
  184. package/dist/docs/api/types/type-aliases/WorldEntityView.md +17 -0
  185. package/dist/docs/guide/accessing-components.md +399 -0
  186. package/dist/docs/guide/authoring-a-behaviour.md +166 -0
  187. package/dist/docs/guide/behaviour-lifecycle.md +43 -0
  188. package/dist/docs/guide/component-catalog.md +59 -0
  189. package/dist/docs/guide/components/_sidebar.json +78 -0
  190. package/dist/docs/guide/components/animation.md +171 -0
  191. package/dist/docs/guide/components/audio.md +181 -0
  192. package/dist/docs/guide/components/camera.md +179 -0
  193. package/dist/docs/guide/components/entity-type.md +141 -0
  194. package/dist/docs/guide/components/image-target-anchor.md +103 -0
  195. package/dist/docs/guide/components/image-target.md +122 -0
  196. package/dist/docs/guide/components/image.md +146 -0
  197. package/dist/docs/guide/components/light.md +157 -0
  198. package/dist/docs/guide/components/material.md +161 -0
  199. package/dist/docs/guide/components/mesh-geometry.md +153 -0
  200. package/dist/docs/guide/components/mesh.md +151 -0
  201. package/dist/docs/guide/components/model.md +96 -0
  202. package/dist/docs/guide/components/name.md +121 -0
  203. package/dist/docs/guide/components/object3d-ref.md +115 -0
  204. package/dist/docs/guide/components/parent-id.md +108 -0
  205. package/dist/docs/guide/components/physics.md +163 -0
  206. package/dist/docs/guide/components/script.md +142 -0
  207. package/dist/docs/guide/components/sprite.md +155 -0
  208. package/dist/docs/guide/components/transform.md +155 -0
  209. package/dist/docs/guide/components/video.md +153 -0
  210. package/dist/docs/guide/concepts.md +34 -0
  211. package/dist/docs/guide/getting-started/creating-objects.md +50 -0
  212. package/dist/docs/guide/getting-started/editing-objects.md +62 -0
  213. package/dist/docs/guide/getting-started/editor/assets-browser.md +55 -0
  214. package/dist/docs/guide/getting-started/editor/hierarchy.md +47 -0
  215. package/dist/docs/guide/getting-started/editor/index.md +16 -0
  216. package/dist/docs/guide/getting-started/editor/inspector.md +36 -0
  217. package/dist/docs/guide/getting-started/editor/modules.md +35 -0
  218. package/dist/docs/guide/getting-started/editor/scene-inspector.md +64 -0
  219. package/dist/docs/guide/getting-started/editor/toolbar.md +39 -0
  220. package/dist/docs/guide/getting-started/editor/viewport.md +43 -0
  221. package/dist/docs/guide/getting-started/first-launch.md +17 -0
  222. package/dist/docs/guide/getting-started/index.md +37 -0
  223. package/dist/docs/guide/getting-started/installation.md +59 -0
  224. package/dist/docs/guide/getting-started/preview-and-test.md +55 -0
  225. package/dist/docs/guide/getting-started/project-types/3d.md +30 -0
  226. package/dist/docs/guide/getting-started/project-types/ar.md +6 -0
  227. package/dist/docs/guide/getting-started/project-types/face-tracking.md +6 -0
  228. package/dist/docs/guide/getting-started/project-types/image-tracking.md +42 -0
  229. package/dist/docs/guide/getting-started/project-types/index.md +25 -0
  230. package/dist/docs/guide/getting-started/project-types/vr.md +6 -0
  231. package/dist/docs/guide/getting-started/projects.md +53 -0
  232. package/dist/docs/guide/getting-started/shortcuts.md +43 -0
  233. package/dist/docs/guide/inspector-data-binding.md +367 -0
  234. package/dist/docs/guide/reading-input.md +202 -0
  235. package/dist/docs/guide/scene/environment.md +101 -0
  236. package/dist/docs/guide/scene/index.md +36 -0
  237. package/dist/docs/guide/scene/postprocessing.md +108 -0
  238. package/dist/docs/guide/spawning/ambient-light.md +28 -0
  239. package/dist/docs/guide/spawning/area-light.md +32 -0
  240. package/dist/docs/guide/spawning/audio.md +42 -0
  241. package/dist/docs/guide/spawning/camera.md +50 -0
  242. package/dist/docs/guide/spawning/capsule.md +29 -0
  243. package/dist/docs/guide/spawning/cube.md +31 -0
  244. package/dist/docs/guide/spawning/cylinder.md +29 -0
  245. package/dist/docs/guide/spawning/directional-light.md +32 -0
  246. package/dist/docs/guide/spawning/empty.md +31 -0
  247. package/dist/docs/guide/spawning/image-target.md +48 -0
  248. package/dist/docs/guide/spawning/image.md +33 -0
  249. package/dist/docs/guide/spawning/index.md +79 -0
  250. package/dist/docs/guide/spawning/model.md +31 -0
  251. package/dist/docs/guide/spawning/plane.md +31 -0
  252. package/dist/docs/guide/spawning/point-light.md +32 -0
  253. package/dist/docs/guide/spawning/sphere.md +29 -0
  254. package/dist/docs/guide/spawning/spot-light.md +32 -0
  255. package/dist/docs/guide/spawning/sprite.md +31 -0
  256. package/dist/docs/guide/spawning/video.md +53 -0
  257. package/dist/docs/guide/system-overview.md +73 -0
  258. package/dist/docs/guide/systems/_sidebar.json +66 -0
  259. package/dist/docs/guide/systems/animation-system.md +32 -0
  260. package/dist/docs/guide/systems/audio-system.md +28 -0
  261. package/dist/docs/guide/systems/camera-sync-system.md +31 -0
  262. package/dist/docs/guide/systems/environment-sync-system.md +31 -0
  263. package/dist/docs/guide/systems/input-system.md +217 -0
  264. package/dist/docs/guide/systems/light-sync-system.md +29 -0
  265. package/dist/docs/guide/systems/material-sync-system.md +32 -0
  266. package/dist/docs/guide/systems/mesh-geometry-system.md +40 -0
  267. package/dist/docs/guide/systems/object-management-system.md +38 -0
  268. package/dist/docs/guide/systems/object-visibility-system.md +26 -0
  269. package/dist/docs/guide/systems/physics-sync-system.md +56 -0
  270. package/dist/docs/guide/systems/postprocessing-sync-system.md +43 -0
  271. package/dist/docs/guide/systems/render-system.md +22 -0
  272. package/dist/docs/guide/systems/script-behaviour-system.md +59 -0
  273. package/dist/docs/guide/systems/transform-sync-system.md +29 -0
  274. package/dist/docs/guide/systems/video-system.md +30 -0
  275. package/dist/docs/guide/world-api.md +405 -0
  276. package/dist/factories/index.cjs +3077 -0
  277. package/dist/factories/index.cjs.map +1 -0
  278. package/dist/factories/index.d.cts +69 -0
  279. package/dist/factories/index.d.ts +69 -0
  280. package/dist/factories/index.js +6 -0
  281. package/dist/factories/index.js.map +1 -0
  282. package/dist/index-B4-YyUNR.d.cts +73 -0
  283. package/dist/index-BZUOKeTO.d.ts +73 -0
  284. package/dist/index.cjs +8584 -0
  285. package/dist/index.cjs.map +1 -0
  286. package/dist/index.d.cts +283 -0
  287. package/dist/index.d.ts +283 -0
  288. package/dist/index.js +1729 -0
  289. package/dist/index.js.map +1 -0
  290. package/dist/systems/index.cjs +5119 -0
  291. package/dist/systems/index.cjs.map +1 -0
  292. package/dist/systems/index.d.cts +200 -0
  293. package/dist/systems/index.d.ts +200 -0
  294. package/dist/systems/index.js +6 -0
  295. package/dist/systems/index.js.map +1 -0
  296. package/dist/types.cjs +4 -0
  297. package/dist/types.cjs.map +1 -0
  298. package/dist/types.d.cts +3 -0
  299. package/dist/types.d.ts +3 -0
  300. package/dist/types.js +3 -0
  301. package/dist/types.js.map +1 -0
  302. package/dist/worldSnapshotUtils.cjs +259 -0
  303. package/dist/worldSnapshotUtils.cjs.map +1 -0
  304. package/dist/worldSnapshotUtils.d.cts +3 -0
  305. package/dist/worldSnapshotUtils.d.ts +3 -0
  306. package/dist/worldSnapshotUtils.js +4 -0
  307. package/dist/worldSnapshotUtils.js.map +1 -0
  308. package/package.json +80 -0
@@ -0,0 +1,141 @@
1
+ # Entity Type
2
+
3
+ Tags an entity with the kind it was created from (`cube`, `sphere`, `model`, `directionalLight`, etc.). Factories use this to drive kind-specific behavior; the editor inspector uses it to select component editors.
4
+
5
+ ## Properties
6
+
7
+ | Property | Type | Description |
8
+ | --- | --- | --- |
9
+ | `value` | `EcsEntityKind \| EcsEntityEditorKind` | Kind tag identifying which factory created this entity (e.g. `cube`, `directionalLight`, `model`). |
10
+
11
+ ## API reference
12
+
13
+ - Class: [`EntityType`](../../api/components/classes/EntityType.md)
14
+ - Source: [`core/components/EntityType.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/EntityType.ts)
15
+
16
+ ## Scripting examples
17
+
18
+ ::: tip Component access patterns
19
+ 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:
20
+
21
+ ```typescript
22
+ // Component on the entity this script is on
23
+ const type = this.getComponent(EntityType);
24
+
25
+ // Component on another entity, found by its scene name
26
+ const other = this.world.getEntityByName("Enemy");
27
+ if (other) {
28
+ const type = this.world.getComponent(other.entityId, EntityType);
29
+ }
30
+ ```
31
+ :::
32
+
33
+ ### Read the entity's own type tag
34
+
35
+ Branch behaviour based on what kind of entity this script is attached to.
36
+
37
+ ```typescript
38
+ import { Behaviour, EntityType } from "@relu-interactives/spatial-ecs";
39
+
40
+ export default class TypeAwareSetup extends Behaviour {
41
+ protected init() {
42
+ const entityType = this.getComponent(EntityType);
43
+ if (!entityType) return;
44
+
45
+ if (entityType.value === "cube") {
46
+ // Run cube-specific logic
47
+ this.transform.scale.x = 2;
48
+ } else if (entityType.value === "sphere") {
49
+ // Run sphere-specific logic
50
+ this.transform.scale.x = 1.5;
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ ### Filter a world query by entity kind
57
+
58
+ Iterate all entities in the scene and apply logic only to those of a specific type.
59
+
60
+ ```typescript
61
+ import { Behaviour, EntityType, TransformComponent } from "@relu-interactives/spatial-ecs";
62
+ import type { StringInput, FloatInput } from "@relu-interactives/spatial-ecs";
63
+
64
+ export default class TypeFilter extends Behaviour {
65
+ data = {
66
+ targetKind: "cube" as StringInput,
67
+ spinSpeed: 1 as FloatInput,
68
+ };
69
+
70
+ protected onUpdate() {
71
+ for (const [id, entityType] of this.world.query([EntityType])) {
72
+ if (entityType.value !== this.data.targetKind) continue;
73
+
74
+ const t = this.world.getComponent(id, TransformComponent);
75
+ if (t) t.rotation.y += this.data.spinSpeed * this.deltaTime;
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ::: tip Read-only tag
82
+ `EntityType.value` is set by the factory that created the entity and should be treated as read-only. Do not mutate it at runtime — it is used by the editor inspector and by hydration to select the correct component editors and restore the correct factory state.
83
+ :::
84
+
85
+ ### Via `ComponentInput` in the inspector
86
+
87
+ 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 `EntityType` instance at runtime.
88
+
89
+ ```typescript
90
+ import {
91
+ Behaviour,
92
+ EntityType,
93
+ type ComponentInput,
94
+ } from "@relu-interactives/spatial-ecs";
95
+
96
+ export default class Example extends Behaviour {
97
+ data = {
98
+ targetEntityType: {
99
+ type: "component",
100
+ value: null,
101
+ } as unknown as ComponentInput,
102
+ };
103
+
104
+ protected onUpdate() {
105
+ const entityType = this.data.targetEntityType.value as EntityType | null;
106
+ if (!entityType) return;
107
+ // Use the live component instance.
108
+ }
109
+ }
110
+ ```
111
+
112
+ ### Via `EntityInput` in the inspector
113
+
114
+ Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
115
+
116
+ ```typescript
117
+ import {
118
+ Behaviour,
119
+ EntityType,
120
+ type EntityInput,
121
+ type WorldEntityView,
122
+ } from "@relu-interactives/spatial-ecs";
123
+
124
+ export default class Example extends Behaviour {
125
+ data = {
126
+ targetEntity: { type: "entity", value: null } as unknown as EntityInput,
127
+ };
128
+
129
+ protected onUpdate() {
130
+ const entity = this.data.targetEntity.value as WorldEntityView | null;
131
+ if (!entity) return;
132
+
133
+ const entityType = this.world.getComponent(
134
+ entity.entityId,
135
+ EntityType,
136
+ ) as EntityType | null;
137
+ if (!entityType) return;
138
+ // Use the component on the picked entity.
139
+ }
140
+ }
141
+ ```
@@ -0,0 +1,103 @@
1
+ # Image Target Anchor
2
+
3
+ Marks an entity as an anchor for an image-tracking target. The image tracking system reveals the entity when the referenced target is found and hides it when the target is lost.
4
+
5
+ ## Editor inspector
6
+
7
+ ![Image Target Anchor inspector](/images/components/ImageTargetAnchor.png)
8
+
9
+ ## Properties
10
+
11
+ | Property | Type | Description |
12
+ | --- | --- | --- |
13
+ | `targetId` | `number \| null` | Tracked target id this anchor follows. `null` when unbound. |
14
+ | `targetUrl` | `string` | Canonical target image URL, retained as a fallback identifier. |
15
+
16
+ ## API reference
17
+
18
+ - Class: [`ImageTargetAnchor`](../../api/components/classes/ImageTargetAnchor.md)
19
+ - Source: [`core/components/ImageTargetAnchor.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/ImageTargetAnchor.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 anchor = this.getComponent(ImageTargetAnchor);
29
+
30
+ // Component on another entity, found by its scene name
31
+ const other = this.world.getEntityByName("CardTarget");
32
+ if (other) {
33
+ const anchor = this.world.getComponent(other.entityId, ImageTargetAnchor);
34
+ }
35
+ ```
36
+ :::
37
+
38
+ ### Run logic when the anchor becomes visible or hidden
39
+
40
+ The image-tracking system sets `Object3DRef.visibility` on anchor entities when a target is found or lost. Use that flag as an event edge detector to trigger game logic.
41
+
42
+
43
+ ::: tip Anchor vs. target entity
44
+ Attach this script to the **anchor child entity** (the one with `ImageTargetAnchor`), not to the root entity that has `ImageTarget`. The tracking system operates on the anchor and its `Object3DRef.visibility`, not on the target root.
45
+ :::
46
+
47
+ ### Via `ComponentInput` in the inspector
48
+
49
+ 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 `ImageTargetAnchor` instance at runtime.
50
+
51
+ ```typescript
52
+ import {
53
+ Behaviour,
54
+ ImageTargetAnchor,
55
+ type ComponentInput,
56
+ } from "@relu-interactives/spatial-ecs";
57
+
58
+ export default class Example extends Behaviour {
59
+ data = {
60
+ targetAnchor: {
61
+ type: "component",
62
+ value: null,
63
+ } as unknown as ComponentInput,
64
+ };
65
+
66
+ protected onUpdate() {
67
+ const anchor = this.data.targetAnchor.value as ImageTargetAnchor | null;
68
+ if (!anchor) return;
69
+ // Use the live component instance.
70
+ }
71
+ }
72
+ ```
73
+
74
+ ### Via `EntityInput` in the inspector
75
+
76
+ Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
77
+
78
+ ```typescript
79
+ import {
80
+ Behaviour,
81
+ ImageTargetAnchor,
82
+ type EntityInput,
83
+ type WorldEntityView,
84
+ } from "@relu-interactives/spatial-ecs";
85
+
86
+ export default class Example extends Behaviour {
87
+ data = {
88
+ targetEntity: { type: "entity", value: null } as unknown as EntityInput,
89
+ };
90
+
91
+ protected onUpdate() {
92
+ const entity = this.data.targetEntity.value as WorldEntityView | null;
93
+ if (!entity) return;
94
+
95
+ const anchor = this.world.getComponent(
96
+ entity.entityId,
97
+ ImageTargetAnchor,
98
+ ) as ImageTargetAnchor | null;
99
+ if (!anchor) return;
100
+ // Use the component on the picked entity.
101
+ }
102
+ }
103
+ ```
@@ -0,0 +1,122 @@
1
+ # Image Target
2
+
3
+ Image-tracking target metadata used by AR projects. Holds the source images users uploaded plus the URL of the compiled `.mind` target file produced by the image-target compiler. Pair with `ImageTargetAnchor` on child entities that should appear when the target is detected.
4
+
5
+ ## Editor inspector
6
+
7
+ ![Image Target inspector](/images/components/ImageTarget.png)
8
+
9
+ ## Properties
10
+
11
+ | Property | Type | Description |
12
+ | --- | --- | --- |
13
+ | `targets` | `ImageTargetReference[]` | Source images that were combined into the compiled `.mind` target. |
14
+ | `compiledTargetUrl` | `string` | URL of the compiled `.mind` target file. Set after the image-target compiler finishes. |
15
+ | `compiledTargetDir` | `string` | Directory containing the compiled `.mind` file (desktop projects). |
16
+ | `texture` | `THREE.Texture \| null` | Optional preview texture used in the editor viewport. `null` when not assigned. |
17
+ | `object` | `THREE.Object3D \| null` | Optional preview object placed in the editor viewport. `null` when not assigned. |
18
+
19
+ ## API reference
20
+
21
+ - Class: [`ImageTarget`](../../api/components/classes/ImageTarget.md)
22
+ - Source: [`core/components/ImageTarget.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/ImageTarget.ts)
23
+
24
+ ## Scripting examples
25
+
26
+ ::: tip Component access patterns
27
+ 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:
28
+
29
+ ```typescript
30
+ // Component on the entity this script is on
31
+ const target = this.getComponent(ImageTarget);
32
+
33
+ // Component on another entity, found by its scene name
34
+ const other = this.world.getEntityByName("CardMarker");
35
+ if (other) {
36
+ const target = this.world.getComponent(other.entityId, ImageTarget);
37
+ }
38
+ ```
39
+ :::
40
+
41
+ ### React to target found / lost events
42
+
43
+ The image-tracking system reveals the entity when its target is detected and hides it when lost. Attach this script to a child entity that has `ImageTargetAnchor` to run logic on those transitions.
44
+
45
+ ```typescript
46
+ import { Behaviour, Object3DRef, AudioComponent } from "@relu-interactives/spatial-ecs";
47
+
48
+ export default class TargetFoundReactor extends Behaviour {
49
+ private onTargetFound() {
50
+ // Play audio, trigger animation, spawn objects, etc.
51
+ const audio = this.getComponent(AudioComponent);
52
+ audio?.play();
53
+ }
54
+
55
+ private onTargetLost() {
56
+ const audio = this.getComponent(AudioComponent);
57
+ audio?.stop();
58
+ }
59
+ }
60
+ ```
61
+
62
+ ::: tip AR-only component
63
+ `ImageTarget` and `ImageTargetAnchor` are specific to **image-tracking** AR projects. The tracking system only runs in preview; behaviour scripts attached to anchor entities will still initialise in the editor, but `Object3DRef.visibility` will remain as authored until a real target is detected at runtime.
64
+ :::
65
+
66
+ ### Via `ComponentInput` in the inspector
67
+
68
+ 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 `ImageTarget` instance at runtime.
69
+
70
+ ```typescript
71
+ import {
72
+ Behaviour,
73
+ ImageTarget,
74
+ type ComponentInput,
75
+ } from "@relu-interactives/spatial-ecs";
76
+
77
+ export default class Example extends Behaviour {
78
+ data = {
79
+ targetImageTarget: {
80
+ type: "component",
81
+ value: null,
82
+ } as unknown as ComponentInput,
83
+ };
84
+
85
+ protected onUpdate() {
86
+ const imageTarget = this.data.targetImageTarget.value as ImageTarget | null;
87
+ if (!imageTarget) return;
88
+ // Use the live component instance.
89
+ }
90
+ }
91
+ ```
92
+
93
+ ### Via `EntityInput` in the inspector
94
+
95
+ Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
96
+
97
+ ```typescript
98
+ import {
99
+ Behaviour,
100
+ ImageTarget,
101
+ type EntityInput,
102
+ type WorldEntityView,
103
+ } from "@relu-interactives/spatial-ecs";
104
+
105
+ export default class Example extends Behaviour {
106
+ data = {
107
+ targetEntity: { type: "entity", value: null } as unknown as EntityInput,
108
+ };
109
+
110
+ protected onUpdate() {
111
+ const entity = this.data.targetEntity.value as WorldEntityView | null;
112
+ if (!entity) return;
113
+
114
+ const imageTarget = this.world.getComponent(
115
+ entity.entityId,
116
+ ImageTarget,
117
+ ) as ImageTarget | null;
118
+ if (!imageTarget) return;
119
+ // Use the component on the picked entity.
120
+ }
121
+ }
122
+ ```
@@ -0,0 +1,146 @@
1
+ # Image
2
+
3
+ Renders a 2D image as a textured quad in the scene. Width/height are in world units. Texture loading is handled by the image system, which populates `ImageComponent.texture` and `ImageComponent.object` asynchronously.
4
+
5
+ ## Editor inspector
6
+
7
+ ![Image inspector](/images/components/Image.png)
8
+
9
+ ## Properties
10
+
11
+ | Property | Type | Description |
12
+ | --- | --- | --- |
13
+ | `path` | `string` | Source URL or `localasset://` path of the image file. |
14
+ | `width` | `number` | Width of the rendered quad in world units. |
15
+ | `height` | `number` | Height of the rendered quad in world units. |
16
+ | `texture` | `THREE.Texture \| null` | Loaded texture, populated asynchronously by the image system. `null` until loaded. |
17
+ | `object` | `THREE.Object3D \| null` | Live three.js object representing the textured quad. `null` until built. |
18
+
19
+ ## API reference
20
+
21
+ - Class: [`ImageComponent`](../../api/components/classes/ImageComponent.md)
22
+ - Source: [`core/components/Image.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/Image.ts)
23
+
24
+ ## Scripting examples
25
+
26
+ ::: tip Component access patterns
27
+ 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:
28
+
29
+ ```typescript
30
+ // Component on the entity this script is on
31
+ const image = this.getComponent(ImageComponent);
32
+
33
+ // Component on another entity, found by its scene name
34
+ const other = this.world.getEntityByName("Banner");
35
+ if (other) {
36
+ const image = this.world.getComponent(other.entityId, ImageComponent);
37
+ }
38
+ ```
39
+ :::
40
+
41
+ ### Smooth resize toward a target size
42
+
43
+ Lerp the image quad's dimensions toward inspector-defined target values, useful for animated UI reveals or zoom effects.
44
+
45
+ ```typescript
46
+ import { Behaviour, ImageComponent } from "@relu-interactives/spatial-ecs";
47
+ import type { FloatInput } from "@relu-interactives/spatial-ecs";
48
+
49
+ export default class ImageResizer extends Behaviour {
50
+ data = {
51
+ targetWidth: 2 as FloatInput,
52
+ targetHeight: 2 as FloatInput,
53
+ speed: 3 as FloatInput,
54
+ };
55
+
56
+ protected onUpdate() {
57
+ const image = this.getComponent(ImageComponent);
58
+ if (!image) return;
59
+
60
+ const k = this.data.speed * this.deltaTime;
61
+ image.width += (this.data.targetWidth - image.width) * k;
62
+ image.height += (this.data.targetHeight - image.height) * k;
63
+ }
64
+ }
65
+ ```
66
+
67
+ ### Show or hide based on a flag
68
+
69
+ Drive the quad's visibility from the inspector or from game logic via `Object3DRef`.
70
+
71
+ ```typescript
72
+ import { Behaviour, ImageComponent, Object3DRef } from "@relu-interactives/spatial-ecs";
73
+ import type { BooleanInput } from "@relu-interactives/spatial-ecs";
74
+
75
+ export default class ImageVisibility extends Behaviour {
76
+ data = {
77
+ visible: true as BooleanInput,
78
+ };
79
+
80
+ protected onUpdate() {
81
+ const image = this.getComponent(ImageComponent);
82
+ if (!image?.object) return; // wait for texture load
83
+
84
+ const ref = this.getComponent(Object3DRef);
85
+ if (ref) ref.visibility = this.data.visible;
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Via `ComponentInput` in the inspector
91
+
92
+ 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 `ImageComponent` instance at runtime.
93
+
94
+ ```typescript
95
+ import {
96
+ Behaviour,
97
+ ImageComponent,
98
+ type ComponentInput,
99
+ } from "@relu-interactives/spatial-ecs";
100
+
101
+ export default class Example extends Behaviour {
102
+ data = {
103
+ targetImage: {
104
+ type: "component",
105
+ value: null,
106
+ } as unknown as ComponentInput,
107
+ };
108
+
109
+ protected onUpdate() {
110
+ const image = this.data.targetImage.value as ImageComponent | null;
111
+ if (!image) return;
112
+ // Use the live component instance.
113
+ }
114
+ }
115
+ ```
116
+
117
+ ### Via `EntityInput` in the inspector
118
+
119
+ Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
120
+
121
+ ```typescript
122
+ import {
123
+ Behaviour,
124
+ ImageComponent,
125
+ type EntityInput,
126
+ type WorldEntityView,
127
+ } from "@relu-interactives/spatial-ecs";
128
+
129
+ export default class Example extends Behaviour {
130
+ data = {
131
+ targetEntity: { type: "entity", value: null } as unknown as EntityInput,
132
+ };
133
+
134
+ protected onUpdate() {
135
+ const entity = this.data.targetEntity.value as WorldEntityView | null;
136
+ if (!entity) return;
137
+
138
+ const image = this.world.getComponent(
139
+ entity.entityId,
140
+ ImageComponent,
141
+ ) as ImageComponent | null;
142
+ if (!image) return;
143
+ // Use the component on the picked entity.
144
+ }
145
+ }
146
+ ```
@@ -0,0 +1,157 @@
1
+ # Light
2
+
3
+ Light source attached to an entity. `type` selects the underlying three.js light class (directional, point, spot, ambient, hemisphere, rect-area). `values` carries authoring state including color, intensity, and type-specific fields (distance, decay, angle, penumbra, width, height).
4
+
5
+ > **Managed by:** [`LightSyncSystem`](../systems/light-sync-system)
6
+
7
+ ## Editor inspector
8
+
9
+ ![Light inspector](/images/components/Light.png)
10
+
11
+ ## Properties
12
+
13
+ | Property | Type | Description |
14
+ | --- | --- | --- |
15
+ | `light` | `THREE.Light` | Live three.js light placed in the scene. Recreated when the project loads. |
16
+ | `type` | `string` | Three.js class name of the light (e.g. `"DirectionalLight"`, `"PointLight"`, `"SpotLight"`). |
17
+ | `values` | `LightValueState` | Serialized authoring state. Saved with the project. |
18
+
19
+ ## API reference
20
+
21
+ - Class: [`LightComponent`](../../api/components/classes/LightComponent.md)
22
+ - Source: [`core/components/Light.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/Light.ts)
23
+
24
+ ## Scripting examples
25
+
26
+ ::: tip Component access patterns
27
+ 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:
28
+
29
+ ```typescript
30
+ // Component on the entity this script is on
31
+ const light = this.getComponent(LightComponent);
32
+
33
+ // Component on another entity, found by its scene name
34
+ const other = this.world.getEntityByName("SpotLight");
35
+ if (other) {
36
+ const light = this.world.getComponent(other.entityId, LightComponent);
37
+ }
38
+ ```
39
+ :::
40
+
41
+ ### Pulse intensity
42
+
43
+ Animate the light's intensity between a min and max value using a sine wave — useful for flickering flames or heartbeat effects.
44
+
45
+ ```typescript
46
+ import { Behaviour, LightComponent } from "@relu-interactives/spatial-ecs";
47
+ import type { FloatInput } from "@relu-interactives/spatial-ecs";
48
+
49
+ export default class LightPulse extends Behaviour {
50
+ data = {
51
+ speed: 2 as FloatInput,
52
+ minIntensity: 0.5 as FloatInput,
53
+ maxIntensity: 3 as FloatInput,
54
+ };
55
+
56
+ private elapsed = 0;
57
+
58
+ protected onUpdate() {
59
+ this.elapsed += this.deltaTime;
60
+ const light = this.getComponent(LightComponent);
61
+ if (!light?.light) return;
62
+
63
+ const t = (Math.sin(this.elapsed * this.data.speed) + 1) * 0.5;
64
+ light.light.intensity =
65
+ this.data.minIntensity + t * (this.data.maxIntensity - this.data.minIntensity);
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### Timed color shift
71
+
72
+ Cycle the light's color through the RGB spectrum over a configurable period.
73
+
74
+ ```typescript
75
+ import { Behaviour, LightComponent } from "@relu-interactives/spatial-ecs";
76
+ import type { FloatInput } from "@relu-interactives/spatial-ecs";
77
+
78
+ export default class LightColorCycle extends Behaviour {
79
+ data = {
80
+ period: 4 as FloatInput,
81
+ };
82
+
83
+ private elapsed = 0;
84
+
85
+ protected onUpdate() {
86
+ this.elapsed += this.deltaTime;
87
+ const light = this.getComponent(LightComponent);
88
+ if (!light?.light) return;
89
+
90
+ const hue = (this.elapsed / this.data.period) % 1;
91
+ (light.light.color as { setHSL(h: number, s: number, l: number): void })
92
+ .setHSL(hue, 1, 0.5);
93
+ }
94
+ }
95
+ ```
96
+
97
+ ::: tip Live light access
98
+ Mutate `light.light.intensity` and `light.light.color` directly for immediate per-frame changes. For changes that should survive a save/reload cycle, also update `light.values.intensity` / `light.values.color` so the authoring state stays in sync.
99
+ :::
100
+
101
+ ### Via `ComponentInput` in the inspector
102
+
103
+ 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 `LightComponent` instance at runtime.
104
+
105
+ ```typescript
106
+ import {
107
+ Behaviour,
108
+ LightComponent,
109
+ type ComponentInput,
110
+ } from "@relu-interactives/spatial-ecs";
111
+
112
+ export default class Example extends Behaviour {
113
+ data = {
114
+ targetLight: {
115
+ type: "component",
116
+ value: null,
117
+ } as unknown as ComponentInput,
118
+ };
119
+
120
+ protected onUpdate() {
121
+ const light = this.data.targetLight.value as LightComponent | null;
122
+ if (!light) return;
123
+ // Use the live component instance.
124
+ }
125
+ }
126
+ ```
127
+
128
+ ### Via `EntityInput` in the inspector
129
+
130
+ Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
131
+
132
+ ```typescript
133
+ import {
134
+ Behaviour,
135
+ LightComponent,
136
+ type EntityInput,
137
+ type WorldEntityView,
138
+ } from "@relu-interactives/spatial-ecs";
139
+
140
+ export default class Example extends Behaviour {
141
+ data = {
142
+ targetEntity: { type: "entity", value: null } as unknown as EntityInput,
143
+ };
144
+
145
+ protected onUpdate() {
146
+ const entity = this.data.targetEntity.value as WorldEntityView | null;
147
+ if (!entity) return;
148
+
149
+ const light = this.world.getComponent(
150
+ entity.entityId,
151
+ LightComponent,
152
+ ) as LightComponent | null;
153
+ if (!light) return;
154
+ // Use the component on the picked entity.
155
+ }
156
+ }
157
+ ```