@needle-tools/engine 4.13.0 → 4.13.1-beta

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 (410) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/README.md +37 -0
  3. package/components.needle.json +1 -1
  4. package/custom-elements.json +138 -4
  5. package/dist/{needle-engine.bundle-CxaKFQVS.min.js → needle-engine.bundle-6774fXoY.min.js} +107 -107
  6. package/dist/{needle-engine.bundle-Dl3TFYyv.js → needle-engine.bundle-CGtsEhyJ.js} +2346 -1844
  7. package/dist/{needle-engine.bundle-J4k4znv8.umd.cjs → needle-engine.bundle-fbFZTOKP.umd.cjs} +108 -108
  8. package/dist/needle-engine.d.ts +3769 -397
  9. package/dist/needle-engine.js +2 -2
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/lib/engine/engine_context.d.ts +16 -0
  13. package/lib/engine/engine_context.js +16 -0
  14. package/lib/engine/engine_context.js.map +1 -1
  15. package/lib/engine/engine_gameobject.d.ts +72 -0
  16. package/lib/engine/engine_gameobject.js +38 -0
  17. package/lib/engine/engine_gameobject.js.map +1 -1
  18. package/lib/engine/engine_input.d.ts +80 -4
  19. package/lib/engine/engine_input.js +78 -2
  20. package/lib/engine/engine_input.js.map +1 -1
  21. package/lib/engine/engine_math.d.ts +81 -2
  22. package/lib/engine/engine_math.js +68 -2
  23. package/lib/engine/engine_math.js.map +1 -1
  24. package/lib/engine/engine_networking.d.ts +181 -14
  25. package/lib/engine/engine_networking.js +181 -14
  26. package/lib/engine/engine_networking.js.map +1 -1
  27. package/lib/engine/engine_networking_auto.d.ts +35 -8
  28. package/lib/engine/engine_networking_auto.js +35 -8
  29. package/lib/engine/engine_networking_auto.js.map +1 -1
  30. package/lib/engine/engine_physics.d.ts +35 -1
  31. package/lib/engine/engine_physics.js +35 -1
  32. package/lib/engine/engine_physics.js.map +1 -1
  33. package/lib/engine/engine_physics_rapier.d.ts +76 -0
  34. package/lib/engine/engine_physics_rapier.js +76 -0
  35. package/lib/engine/engine_physics_rapier.js.map +1 -1
  36. package/lib/engine/engine_serialization_decorator.d.ts +28 -2
  37. package/lib/engine/engine_serialization_decorator.js +28 -2
  38. package/lib/engine/engine_serialization_decorator.js.map +1 -1
  39. package/lib/engine/engine_time.d.ts +23 -3
  40. package/lib/engine/engine_time.js +23 -3
  41. package/lib/engine/engine_time.js.map +1 -1
  42. package/lib/engine/engine_util_decorator.d.ts +31 -1
  43. package/lib/engine/engine_util_decorator.js +31 -1
  44. package/lib/engine/engine_util_decorator.js.map +1 -1
  45. package/lib/engine/engine_utils.d.ts +21 -5
  46. package/lib/engine/engine_utils.js +21 -5
  47. package/lib/engine/engine_utils.js.map +1 -1
  48. package/lib/engine/extensions/NEEDLE_materialx.d.ts +2 -2
  49. package/lib/engine/extensions/NEEDLE_materialx.js +2 -2
  50. package/lib/engine/extensions/NEEDLE_materialx.js.map +1 -1
  51. package/lib/engine/extensions/index.d.ts +1 -1
  52. package/lib/engine/extensions/index.js +1 -1
  53. package/lib/engine/extensions/index.js.map +1 -1
  54. package/lib/engine-components/AlignmentConstraint.d.ts +23 -3
  55. package/lib/engine-components/AlignmentConstraint.js +23 -3
  56. package/lib/engine-components/AlignmentConstraint.js.map +1 -1
  57. package/lib/engine-components/Animation.d.ts +42 -0
  58. package/lib/engine-components/Animation.js +36 -0
  59. package/lib/engine-components/Animation.js.map +1 -1
  60. package/lib/engine-components/Animator.d.ts +37 -4
  61. package/lib/engine-components/Animator.js +37 -4
  62. package/lib/engine-components/Animator.js.map +1 -1
  63. package/lib/engine-components/AudioListener.d.ts +1 -1
  64. package/lib/engine-components/AudioListener.js +1 -1
  65. package/lib/engine-components/AudioSource.d.ts +32 -10
  66. package/lib/engine-components/AudioSource.js +32 -10
  67. package/lib/engine-components/AudioSource.js.map +1 -1
  68. package/lib/engine-components/AxesHelper.d.ts +22 -3
  69. package/lib/engine-components/AxesHelper.js +22 -3
  70. package/lib/engine-components/AxesHelper.js.map +1 -1
  71. package/lib/engine-components/BasicIKConstraint.d.ts +27 -4
  72. package/lib/engine-components/BasicIKConstraint.js +27 -4
  73. package/lib/engine-components/BasicIKConstraint.js.map +1 -1
  74. package/lib/engine-components/Camera.d.ts +32 -2
  75. package/lib/engine-components/Camera.js +32 -2
  76. package/lib/engine-components/Camera.js.map +1 -1
  77. package/lib/engine-components/CharacterController.d.ts +68 -4
  78. package/lib/engine-components/CharacterController.js +68 -4
  79. package/lib/engine-components/CharacterController.js.map +1 -1
  80. package/lib/engine-components/Collider.d.ts +69 -12
  81. package/lib/engine-components/Collider.js +69 -12
  82. package/lib/engine-components/Collider.js.map +1 -1
  83. package/lib/engine-components/ContactShadows.d.ts +26 -6
  84. package/lib/engine-components/ContactShadows.js +31 -8
  85. package/lib/engine-components/ContactShadows.js.map +1 -1
  86. package/lib/engine-components/DeleteBox.d.ts +43 -2
  87. package/lib/engine-components/DeleteBox.js +43 -2
  88. package/lib/engine-components/DeleteBox.js.map +1 -1
  89. package/lib/engine-components/DeviceFlag.d.ts +21 -2
  90. package/lib/engine-components/DeviceFlag.js +21 -2
  91. package/lib/engine-components/DeviceFlag.js.map +1 -1
  92. package/lib/engine-components/DragControls.d.ts +32 -2
  93. package/lib/engine-components/DragControls.js +32 -2
  94. package/lib/engine-components/DragControls.js.map +1 -1
  95. package/lib/engine-components/DropListener.d.ts +33 -21
  96. package/lib/engine-components/DropListener.js +33 -21
  97. package/lib/engine-components/DropListener.js.map +1 -1
  98. package/lib/engine-components/Duplicatable.d.ts +36 -5
  99. package/lib/engine-components/Duplicatable.js +36 -5
  100. package/lib/engine-components/Duplicatable.js.map +1 -1
  101. package/lib/engine-components/EventList.d.ts +38 -10
  102. package/lib/engine-components/EventList.js +38 -10
  103. package/lib/engine-components/EventList.js.map +1 -1
  104. package/lib/engine-components/EventTrigger.d.ts +1 -1
  105. package/lib/engine-components/EventTrigger.js +1 -1
  106. package/lib/engine-components/Fog.d.ts +23 -1
  107. package/lib/engine-components/Fog.js +23 -1
  108. package/lib/engine-components/Fog.js.map +1 -1
  109. package/lib/engine-components/GridHelper.d.ts +18 -2
  110. package/lib/engine-components/GridHelper.js +18 -2
  111. package/lib/engine-components/GridHelper.js.map +1 -1
  112. package/lib/engine-components/GroundProjection.d.ts +24 -2
  113. package/lib/engine-components/GroundProjection.js +24 -2
  114. package/lib/engine-components/GroundProjection.js.map +1 -1
  115. package/lib/engine-components/Interactable.d.ts +17 -2
  116. package/lib/engine-components/Interactable.js +17 -2
  117. package/lib/engine-components/Interactable.js.map +1 -1
  118. package/lib/engine-components/Joints.d.ts +50 -7
  119. package/lib/engine-components/Joints.js +50 -7
  120. package/lib/engine-components/Joints.js.map +1 -1
  121. package/lib/engine-components/LODGroup.d.ts +36 -14
  122. package/lib/engine-components/LODGroup.js +43 -11
  123. package/lib/engine-components/LODGroup.js.map +1 -1
  124. package/lib/engine-components/Light.d.ts +30 -5
  125. package/lib/engine-components/Light.js +30 -5
  126. package/lib/engine-components/Light.js.map +1 -1
  127. package/lib/engine-components/LookAtConstraint.d.ts +22 -7
  128. package/lib/engine-components/LookAtConstraint.js +22 -7
  129. package/lib/engine-components/LookAtConstraint.js.map +1 -1
  130. package/lib/engine-components/NeedleMenu.d.ts +27 -5
  131. package/lib/engine-components/NeedleMenu.js +27 -5
  132. package/lib/engine-components/NeedleMenu.js.map +1 -1
  133. package/lib/engine-components/NestedGltf.d.ts +39 -4
  134. package/lib/engine-components/NestedGltf.js +42 -4
  135. package/lib/engine-components/NestedGltf.js.map +1 -1
  136. package/lib/engine-components/OffsetConstraint.d.ts +27 -3
  137. package/lib/engine-components/OffsetConstraint.js +27 -3
  138. package/lib/engine-components/OffsetConstraint.js.map +1 -1
  139. package/lib/engine-components/OrbitControls.d.ts +41 -3
  140. package/lib/engine-components/OrbitControls.js +41 -3
  141. package/lib/engine-components/OrbitControls.js.map +1 -1
  142. package/lib/engine-components/PlayerColor.d.ts +1 -1
  143. package/lib/engine-components/PlayerColor.js +1 -1
  144. package/lib/engine-components/ReflectionProbe.d.ts +17 -2
  145. package/lib/engine-components/ReflectionProbe.js +17 -3
  146. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  147. package/lib/engine-components/Renderer.d.ts +34 -0
  148. package/lib/engine-components/Renderer.js +35 -2
  149. package/lib/engine-components/Renderer.js.map +1 -1
  150. package/lib/engine-components/SceneSwitcher.d.ts +11 -0
  151. package/lib/engine-components/SceneSwitcher.js +11 -0
  152. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  153. package/lib/engine-components/ScreenCapture.d.ts +38 -6
  154. package/lib/engine-components/ScreenCapture.js +38 -6
  155. package/lib/engine-components/ScreenCapture.js.map +1 -1
  156. package/lib/engine-components/Skybox.d.ts +1 -1
  157. package/lib/engine-components/Skybox.js +1 -1
  158. package/lib/engine-components/SmoothFollow.d.ts +66 -7
  159. package/lib/engine-components/SmoothFollow.js +66 -7
  160. package/lib/engine-components/SmoothFollow.js.map +1 -1
  161. package/lib/engine-components/SpatialTrigger.d.ts +48 -1
  162. package/lib/engine-components/SpatialTrigger.js +48 -1
  163. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  164. package/lib/engine-components/SpectatorCamera.d.ts +21 -3
  165. package/lib/engine-components/SpectatorCamera.js +21 -3
  166. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  167. package/lib/engine-components/SyncedRoom.d.ts +7 -1
  168. package/lib/engine-components/SyncedRoom.js +7 -1
  169. package/lib/engine-components/SyncedRoom.js.map +1 -1
  170. package/lib/engine-components/SyncedTransform.d.ts +55 -6
  171. package/lib/engine-components/SyncedTransform.js +55 -6
  172. package/lib/engine-components/SyncedTransform.js.map +1 -1
  173. package/lib/engine-components/TransformGizmo.d.ts +30 -3
  174. package/lib/engine-components/TransformGizmo.js +30 -3
  175. package/lib/engine-components/TransformGizmo.js.map +1 -1
  176. package/lib/engine-components/VideoPlayer.d.ts +33 -6
  177. package/lib/engine-components/VideoPlayer.js +45 -6
  178. package/lib/engine-components/VideoPlayer.js.map +1 -1
  179. package/lib/engine-components/Voip.d.ts +33 -2
  180. package/lib/engine-components/Voip.js +33 -2
  181. package/lib/engine-components/Voip.js.map +1 -1
  182. package/lib/engine-components/export/usdz/USDZExporter.d.ts +47 -13
  183. package/lib/engine-components/export/usdz/USDZExporter.js +47 -13
  184. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  185. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +82 -3
  186. package/lib/engine-components/particlesystem/ParticleSystem.js +82 -3
  187. package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
  188. package/lib/engine-components/postprocessing/Effects/Antialiasing.d.ts +1 -0
  189. package/lib/engine-components/postprocessing/Effects/Antialiasing.js +1 -0
  190. package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
  191. package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -1
  192. package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -1
  193. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +1 -1
  194. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +1 -1
  195. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +1 -1
  196. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +1 -1
  197. package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +1 -1
  198. package/lib/engine-components/postprocessing/Effects/DepthOfField.js +1 -1
  199. package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
  200. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
  201. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
  202. package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +1 -1
  203. package/lib/engine-components/postprocessing/Effects/Pixelation.js +1 -1
  204. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.d.ts +1 -1
  205. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +1 -1
  206. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +1 -1
  207. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +1 -1
  208. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +1 -1
  209. package/lib/engine-components/postprocessing/Effects/Sharpening.js +1 -1
  210. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +1 -1
  211. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +1 -1
  212. package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +1 -1
  213. package/lib/engine-components/postprocessing/Effects/Tonemapping.js +1 -1
  214. package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +1 -1
  215. package/lib/engine-components/postprocessing/Effects/Vignette.js +1 -1
  216. package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +1 -1
  217. package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
  218. package/lib/engine-components/postprocessing/Volume.d.ts +1 -1
  219. package/lib/engine-components/postprocessing/Volume.js +1 -1
  220. package/lib/engine-components/splines/Spline.d.ts +409 -12
  221. package/lib/engine-components/splines/Spline.js +409 -12
  222. package/lib/engine-components/splines/Spline.js.map +1 -1
  223. package/lib/engine-components/splines/SplineUtils.d.ts +1 -0
  224. package/lib/engine-components/splines/SplineUtils.js +1 -0
  225. package/lib/engine-components/splines/SplineUtils.js.map +1 -1
  226. package/lib/engine-components/splines/SplineWalker.d.ts +3 -1
  227. package/lib/engine-components/splines/SplineWalker.js +3 -1
  228. package/lib/engine-components/splines/SplineWalker.js.map +1 -1
  229. package/lib/engine-components/timeline/PlayableDirector.d.ts +99 -14
  230. package/lib/engine-components/timeline/PlayableDirector.js +91 -25
  231. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  232. package/lib/engine-components/ui/Button.d.ts +29 -3
  233. package/lib/engine-components/ui/Button.js +29 -3
  234. package/lib/engine-components/ui/Button.js.map +1 -1
  235. package/lib/engine-components/ui/Canvas.d.ts +29 -4
  236. package/lib/engine-components/ui/Canvas.js +29 -4
  237. package/lib/engine-components/ui/Canvas.js.map +1 -1
  238. package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
  239. package/lib/engine-components/ui/CanvasGroup.js +1 -1
  240. package/lib/engine-components/ui/EventSystem.d.ts +1 -1
  241. package/lib/engine-components/ui/EventSystem.js +1 -1
  242. package/lib/engine-components/ui/Graphic.d.ts +1 -0
  243. package/lib/engine-components/ui/Graphic.js +1 -0
  244. package/lib/engine-components/ui/Graphic.js.map +1 -1
  245. package/lib/engine-components/ui/Image.d.ts +22 -3
  246. package/lib/engine-components/ui/Image.js +22 -3
  247. package/lib/engine-components/ui/Image.js.map +1 -1
  248. package/lib/engine-components/ui/InputField.d.ts +1 -1
  249. package/lib/engine-components/ui/InputField.js +1 -1
  250. package/lib/engine-components/ui/Layout.d.ts +3 -0
  251. package/lib/engine-components/ui/Layout.js +3 -0
  252. package/lib/engine-components/ui/Layout.js.map +1 -1
  253. package/lib/engine-components/ui/Outline.d.ts +1 -1
  254. package/lib/engine-components/ui/Outline.js +1 -1
  255. package/lib/engine-components/ui/PointerEvents.d.ts +1 -1
  256. package/lib/engine-components/ui/PointerEvents.js +1 -1
  257. package/lib/engine-components/ui/Raycaster.d.ts +55 -6
  258. package/lib/engine-components/ui/Raycaster.js +55 -6
  259. package/lib/engine-components/ui/Raycaster.js.map +1 -1
  260. package/lib/engine-components/ui/RectTransform.d.ts +1 -1
  261. package/lib/engine-components/ui/RectTransform.js +1 -1
  262. package/lib/engine-components/ui/SpatialHtml.d.ts +1 -1
  263. package/lib/engine-components/ui/SpatialHtml.js +1 -1
  264. package/lib/engine-components/ui/Text.d.ts +23 -1
  265. package/lib/engine-components/ui/Text.js +23 -1
  266. package/lib/engine-components/ui/Text.js.map +1 -1
  267. package/lib/engine-components/utils/LookAt.d.ts +1 -1
  268. package/lib/engine-components/utils/LookAt.js +1 -1
  269. package/lib/engine-components/utils/OpenURL.d.ts +1 -1
  270. package/lib/engine-components/utils/OpenURL.js +1 -1
  271. package/lib/engine-components/web/Clickthrough.d.ts +116 -7
  272. package/lib/engine-components/web/Clickthrough.js +116 -7
  273. package/lib/engine-components/web/Clickthrough.js.map +1 -1
  274. package/lib/engine-components/web/CursorFollow.d.ts +171 -7
  275. package/lib/engine-components/web/CursorFollow.js +171 -7
  276. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  277. package/lib/engine-components/web/HoverAnimation.d.ts +140 -11
  278. package/lib/engine-components/web/HoverAnimation.js +140 -11
  279. package/lib/engine-components/web/HoverAnimation.js.map +1 -1
  280. package/lib/engine-components/web/ScrollFollow.d.ts +4 -1
  281. package/lib/engine-components/web/ScrollFollow.js +4 -1
  282. package/lib/engine-components/web/ScrollFollow.js.map +1 -1
  283. package/lib/engine-components/web/ViewBox.d.ts +116 -16
  284. package/lib/engine-components/web/ViewBox.js +110 -16
  285. package/lib/engine-components/web/ViewBox.js.map +1 -1
  286. package/lib/engine-components/webxr/TeleportTarget.d.ts +21 -2
  287. package/lib/engine-components/webxr/TeleportTarget.js +21 -2
  288. package/lib/engine-components/webxr/TeleportTarget.js.map +1 -1
  289. package/lib/engine-components/webxr/WebXR.d.ts +10 -2
  290. package/lib/engine-components/webxr/WebXR.js +10 -2
  291. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  292. package/lib/engine-components/webxr/WebXRAvatar.d.ts +39 -2
  293. package/lib/engine-components/webxr/WebXRAvatar.js +35 -3
  294. package/lib/engine-components/webxr/WebXRAvatar.js.map +1 -1
  295. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +266 -30
  296. package/lib/engine-components/webxr/WebXRImageTracking.js +266 -30
  297. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  298. package/lib/engine-components/webxr/WebXRPlaneTracking.d.ts +1 -1
  299. package/lib/engine-components/webxr/WebXRPlaneTracking.js +1 -1
  300. package/lib/engine-components/webxr/XRFlag.d.ts +29 -2
  301. package/lib/engine-components/webxr/XRFlag.js +29 -2
  302. package/lib/engine-components/webxr/XRFlag.js.map +1 -1
  303. package/package.json +1 -1
  304. package/plugins/vite/custom-element-data.js +128 -19
  305. package/src/engine/engine_context.ts +16 -0
  306. package/src/engine/engine_gameobject.ts +73 -0
  307. package/src/engine/engine_input.ts +83 -7
  308. package/src/engine/engine_math.ts +81 -2
  309. package/src/engine/engine_networking.ts +186 -17
  310. package/src/engine/engine_networking_auto.ts +36 -9
  311. package/src/engine/engine_physics.ts +37 -1
  312. package/src/engine/engine_physics_rapier.ts +77 -0
  313. package/src/engine/engine_serialization_decorator.ts +28 -2
  314. package/src/engine/engine_time.ts +23 -3
  315. package/src/engine/engine_util_decorator.ts +31 -1
  316. package/src/engine/engine_utils.ts +21 -5
  317. package/src/engine/extensions/NEEDLE_materialx.ts +5 -4
  318. package/src/engine/extensions/index.ts +2 -2
  319. package/src/engine-components/AlignmentConstraint.ts +24 -4
  320. package/src/engine-components/Animation.ts +44 -2
  321. package/src/engine-components/Animator.ts +40 -7
  322. package/src/engine-components/AudioListener.ts +1 -1
  323. package/src/engine-components/AudioSource.ts +37 -15
  324. package/src/engine-components/AxesHelper.ts +23 -4
  325. package/src/engine-components/BasicIKConstraint.ts +28 -5
  326. package/src/engine-components/Camera.ts +33 -3
  327. package/src/engine-components/CharacterController.ts +74 -7
  328. package/src/engine-components/Collider.ts +78 -21
  329. package/src/engine-components/ContactShadows.ts +36 -11
  330. package/src/engine-components/DeleteBox.ts +43 -2
  331. package/src/engine-components/DeviceFlag.ts +22 -3
  332. package/src/engine-components/DragControls.ts +32 -2
  333. package/src/engine-components/DropListener.ts +41 -29
  334. package/src/engine-components/Duplicatable.ts +37 -6
  335. package/src/engine-components/EventList.ts +41 -13
  336. package/src/engine-components/EventTrigger.ts +1 -1
  337. package/src/engine-components/Fog.ts +23 -1
  338. package/src/engine-components/GridHelper.ts +18 -2
  339. package/src/engine-components/GroundProjection.ts +25 -3
  340. package/src/engine-components/Interactable.ts +17 -2
  341. package/src/engine-components/Joints.ts +51 -8
  342. package/src/engine-components/LODGroup.ts +45 -11
  343. package/src/engine-components/Light.ts +35 -13
  344. package/src/engine-components/LookAtConstraint.ts +26 -8
  345. package/src/engine-components/NeedleMenu.ts +29 -7
  346. package/src/engine-components/NestedGltf.ts +40 -4
  347. package/src/engine-components/OffsetConstraint.ts +27 -3
  348. package/src/engine-components/OrbitControls.ts +41 -3
  349. package/src/engine-components/PlayerColor.ts +1 -1
  350. package/src/engine-components/ReflectionProbe.ts +19 -5
  351. package/src/engine-components/Renderer.ts +34 -1
  352. package/src/engine-components/SceneSwitcher.ts +11 -0
  353. package/src/engine-components/ScreenCapture.ts +41 -9
  354. package/src/engine-components/Skybox.ts +1 -1
  355. package/src/engine-components/SmoothFollow.ts +68 -7
  356. package/src/engine-components/SpatialTrigger.ts +51 -4
  357. package/src/engine-components/SpectatorCamera.ts +23 -5
  358. package/src/engine-components/SyncedRoom.ts +8 -2
  359. package/src/engine-components/SyncedTransform.ts +59 -10
  360. package/src/engine-components/TransformGizmo.ts +31 -4
  361. package/src/engine-components/VideoPlayer.ts +48 -6
  362. package/src/engine-components/Voip.ts +33 -2
  363. package/src/engine-components/export/usdz/USDZExporter.ts +47 -13
  364. package/src/engine-components/particlesystem/ParticleSystem.ts +84 -5
  365. package/src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -0
  366. package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -1
  367. package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +1 -1
  368. package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +1 -1
  369. package/src/engine-components/postprocessing/Effects/DepthOfField.ts +1 -1
  370. package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
  371. package/src/engine-components/postprocessing/Effects/Pixelation.ts +1 -1
  372. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +1 -1
  373. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +1 -1
  374. package/src/engine-components/postprocessing/Effects/Sharpening.ts +1 -1
  375. package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +1 -1
  376. package/src/engine-components/postprocessing/Effects/Tonemapping.ts +1 -1
  377. package/src/engine-components/postprocessing/Effects/Vignette.ts +1 -1
  378. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
  379. package/src/engine-components/postprocessing/Volume.ts +1 -1
  380. package/src/engine-components/splines/Spline.ts +412 -14
  381. package/src/engine-components/splines/SplineUtils.ts +1 -0
  382. package/src/engine-components/splines/SplineWalker.ts +4 -2
  383. package/src/engine-components/timeline/PlayableDirector.ts +104 -27
  384. package/src/engine-components/ui/Button.ts +29 -3
  385. package/src/engine-components/ui/Canvas.ts +29 -4
  386. package/src/engine-components/ui/CanvasGroup.ts +2 -2
  387. package/src/engine-components/ui/EventSystem.ts +1 -1
  388. package/src/engine-components/ui/Graphic.ts +1 -0
  389. package/src/engine-components/ui/Image.ts +22 -3
  390. package/src/engine-components/ui/InputField.ts +2 -2
  391. package/src/engine-components/ui/Layout.ts +3 -0
  392. package/src/engine-components/ui/Outline.ts +1 -1
  393. package/src/engine-components/ui/PointerEvents.ts +1 -1
  394. package/src/engine-components/ui/Raycaster.ts +57 -8
  395. package/src/engine-components/ui/RectTransform.ts +2 -2
  396. package/src/engine-components/ui/SpatialHtml.ts +1 -1
  397. package/src/engine-components/ui/Text.ts +24 -2
  398. package/src/engine-components/utils/LookAt.ts +1 -1
  399. package/src/engine-components/utils/OpenURL.ts +1 -1
  400. package/src/engine-components/web/Clickthrough.ts +119 -10
  401. package/src/engine-components/web/CursorFollow.ts +174 -9
  402. package/src/engine-components/web/HoverAnimation.ts +142 -13
  403. package/src/engine-components/web/ScrollFollow.ts +4 -1
  404. package/src/engine-components/web/ViewBox.ts +118 -18
  405. package/src/engine-components/webxr/TeleportTarget.ts +23 -4
  406. package/src/engine-components/webxr/WebXR.ts +11 -3
  407. package/src/engine-components/webxr/WebXRAvatar.ts +41 -4
  408. package/src/engine-components/webxr/WebXRImageTracking.ts +282 -38
  409. package/src/engine-components/webxr/WebXRPlaneTracking.ts +1 -1
  410. package/src/engine-components/webxr/XRFlag.ts +30 -3
@@ -17,20 +17,15 @@ import * as Tracks from "./TimelineTracks.js";
17
17
  const debug = getParam("debugtimeline");
18
18
 
19
19
  /**
20
- * The wrap mode of the {@link PlayableDirector}.
20
+ * Controls how the {@link PlayableDirector} behaves when playback reaches the end.
21
+ * @see {@link PlayableDirector.extrapolationMode}
21
22
  */
22
23
  export enum DirectorWrapMode {
23
- /// <summary>
24
- /// <para>Hold the last frame when the playable time reaches it's duration.</para>
25
- /// </summary>
24
+ /** Hold the last frame when playback reaches the end of the timeline. */
26
25
  Hold = 0,
27
- /// <summary>
28
- /// <para>Loop back to zero time and continue playing.</para>
29
- /// </summary>
26
+ /** Loop back to the start and continue playing indefinitely. */
30
27
  Loop = 1,
31
- /// <summary>
32
- /// <para>Do not keep playing when the time reaches the duration.</para>
33
- /// </summary>
28
+ /** Stop playback when the end is reached. The timeline will not loop. */
34
29
  None = 2,
35
30
  }
36
31
 
@@ -53,26 +48,76 @@ export enum ClipExtrapolation {
53
48
  export type CreateTrackFunction = (director: PlayableDirector, track: Models.TrackModel) => Tracks.TrackHandler | undefined | null;
54
49
 
55
50
  /**
56
- * The PlayableDirector component is the main component to control timelines in needle engine.
57
- * It is used to play, pause, stop and evaluate timelines.
58
- * Assign a TimelineAsset to the `playableAsset` property to start playing a timeline.
51
+ * PlayableDirector is the main component for controlling timelines in Needle Engine.
52
+ * It orchestrates playback of TimelineAssets containing animation, audio, signal,
53
+ * control, and activation tracks.
54
+ *
55
+ * **Supported track types:**
56
+ * - Animation tracks - animate objects using AnimationClips
57
+ * - Audio tracks - play synchronized audio
58
+ * - Activation tracks - show/hide objects at specific times
59
+ * - Signal tracks - trigger events at specific points
60
+ * - Control tracks - control nested timelines or prefab instances
61
+ * - Marker tracks - add metadata and navigation points
62
+ *
63
+ * [![](https://cloud.needle.tools/-/media/HFudFwl8J8D-Kt_VPu7pRw.gif)](https://engine.needle.tools/samples/bike-scrollytelling-responsive-3d)
64
+ *
65
+ * [![](https://cloud.needle.tools/-/media/xJ1rI3STbZRnOoWJrSzqlQ.gif)](https://app.songsofcultures.com/?scene=little-brother)
66
+ *
67
+ * **Playback control:**
68
+ * Use `play()`, `pause()`, `stop()` for basic control.
69
+ * Set `time` directly and call `evaluate()` for scrubbing.
70
+ * Adjust `speed` for playback rate and `weight` for blending.
71
+ *
72
+ * @example Basic timeline playback
73
+ * ```ts
74
+ * const director = myObject.getComponent(PlayableDirector);
75
+ * director.play();
76
+ * // Jump to specific time
77
+ * director.time = 2.5;
78
+ * director.evaluate();
79
+ * ```
80
+ *
81
+ * @example Control playback speed
82
+ * ```ts
83
+ * director.speed = 0.5; // Half speed
84
+ * director.speed = -1; // Reverse playback
85
+ * ```
86
+ *
87
+ * - Example: https://engine.needle.tools/samples-uploads/product-flyover/
88
+ *
59
89
  * @summary Controls and plays TimelineAssets
60
90
  * @category Animation and Sequencing
61
91
  * @group Components
92
+ * @see {@link Animator} for playing individual AnimationClips
93
+ * @see {@link AudioSource} for standalone audio playback
94
+ * @see {@link SignalReceiver} for handling timeline signals
95
+ * @link https://engine.needle.tools/samples/?overlay=samples&tag=animation
96
+ * @link https://app.songsofcultures.com/
62
97
  */
63
98
  export class PlayableDirector extends Behaviour {
64
99
 
65
100
  private static createTrackFunctions: { [key: string]: CreateTrackFunction } = {};
101
+
102
+ /**
103
+ * Register a function to create a track handler for a custom track type.
104
+ * This allows you to extend the timeline system with your own track types and handlers.
105
+ */
66
106
  static registerCreateTrack(type: string, fn: CreateTrackFunction) {
67
107
  this.createTrackFunctions[type] = fn;
68
108
  }
69
109
 
70
110
  /**
71
- * The timeline asset that is played by this director.
111
+ * The timeline asset containing tracks, clips, and markers that this director will play.
112
+ * Assign a timeline asset exported from Unity or Blender to enable playback.
72
113
  */
73
114
  playableAsset?: Models.TimelineAssetModel;
74
115
 
75
- /** Set to true to start playing the timeline when the scene starts */
116
+ /**
117
+ * When true, the timeline starts playing automatically when the component awakens.
118
+ * Set to false to control playback manually via `play()`.
119
+ * @default false
120
+ */
76
121
  @serializable()
77
122
  playOnAwake?: boolean;
78
123
 
@@ -83,11 +128,18 @@ export class PlayableDirector extends Behaviour {
83
128
  @serializable()
84
129
  extrapolationMode: DirectorWrapMode = DirectorWrapMode.Loop;
85
130
 
86
- /** @returns true if the timeline is currently playing */
131
+ /** Returns true if the timeline is currently playing (not paused or stopped). */
87
132
  get isPlaying(): boolean { return this._isPlaying; }
88
- /** @returns true if the timeline is currently paused */
133
+ /** Returns true if the timeline is currently paused. */
89
134
  get isPaused(): boolean { return this._isPaused; }
90
- /** the current time of the timeline */
135
+ /**
136
+ * The current playback time in seconds. Set this and call `evaluate()` to scrub.
137
+ * @example Scrub to a specific time
138
+ * ```ts
139
+ * director.time = 5.0;
140
+ * director.evaluate();
141
+ * ```
142
+ */
91
143
  get time(): number { return this._time; }
92
144
  set time(value: number) {
93
145
  if (typeof value === "number" && !Number.isNaN(value))
@@ -96,17 +148,32 @@ export class PlayableDirector extends Behaviour {
96
148
  console.error("INVALID TIMELINE.TIME VALUE", value, this.name)
97
149
  };
98
150
  }
99
- /** the duration of the timeline */
151
+ /** The total duration of the timeline in seconds (read from the longest track/clip). */
100
152
  get duration(): number { return this._duration; }
101
153
  set duration(value: number) { this._duration = value; }
102
- /** the weight of the timeline. Set to a value below 1 to blend with other timelines */
154
+ /**
155
+ * The blend weight of the timeline (0-1). Use values below 1 to blend
156
+ * timeline animations with other animations like those from an Animator.
157
+ */
103
158
  get weight(): number { return this._weight; };
104
159
  set weight(value: number) { this._weight = value; }
105
- /** the playback speed of the timeline */
160
+ /**
161
+ * The playback speed multiplier. Set to negative values for reverse playback.
162
+ * @example Reverse playback at double speed
163
+ * ```ts
164
+ * director.speed = -2;
165
+ * ```
166
+ */
106
167
  get speed(): number { return this._speed; }
107
168
  set speed(value: number) { this._speed = value; }
108
169
 
109
- /** When enabled the timeline will wait for audio tracks to load at the current time before starting to play */
170
+ /**
171
+ * When true, `play()` will wait for audio tracks to load and for user interaction
172
+ * before starting playback. Web browsers require user interaction (click/tap) before
173
+ * allowing audio to play - this ensures audio is synchronized with the timeline.
174
+ * Set to false if you need immediate visual playback and can tolerate audio delay.
175
+ * @default true
176
+ */
110
177
  waitForAudio: boolean = true;
111
178
 
112
179
  private _visibilityChangeEvt?: any;
@@ -223,9 +290,9 @@ export class PlayableDirector extends Behaviour {
223
290
  await delay(200);
224
291
  }
225
292
  this.invokeStateChangedMethodsOnTracks();
226
- // Update timeline in LateUpdate to give other scripts time to react to the updated state
227
- // e.g. if we animate OrbitControls look at target we want those changes to be applied in onBeforeRender
228
- // if we use onBeforeRender here it will be called *after* the regular onBeforeRender events
293
+ // Update timeline in LateUpdate to give other scripts time to react to the updated state
294
+ // e.g. if we animate OrbitControls look at target we want those changes to be applied in onBeforeRender
295
+ // if we use onBeforeRender here it will be called *after* the regular onBeforeRender events
229
296
  // which is too late
230
297
  this._internalUpdateRoutine = this.startCoroutine(this.internalUpdate(), FrameEvent.LateUpdate);
231
298
  }
@@ -762,8 +829,18 @@ export class PlayableDirector extends Behaviour {
762
829
  }
763
830
  }
764
831
 
765
- /**
766
- * Experimental interface for receiving timeline animation callbacks. Register at the PlayableDirector
832
+ /**
833
+ * Interface for receiving callbacks during timeline animation evaluation.
834
+ * Allows modification of position/rotation values before they are applied.
835
+ *
836
+ * **Registration:**
837
+ * ```ts
838
+ * director.registerAnimationCallback(this);
839
+ * // Later: director.unregisterAnimationCallback(this);
840
+ * ```
841
+ *
842
+ * @experimental This interface may change in future versions
843
+ * @see {@link PlayableDirector.registerAnimationCallback}
767
844
  */
768
845
  export interface ITimelineAnimationCallbacks {
769
846
  /**
@@ -61,12 +61,38 @@ class AnimationTriggers {
61
61
  }
62
62
 
63
63
  /**
64
- * Button is a UI component that can be clicked by the user to perform an action.
65
- * It supports different visual states such as normal, highlighted, pressed, and disabled.
66
- * You can customize the button's appearance using colors or animations for each state.
64
+ * [Button](https://engine.needle.tools/docs/api/Button) is a UI component that can be clicked to trigger actions.
65
+ * Supports visual states (normal, highlighted, pressed, disabled) with
66
+ * color tints or animation transitions.
67
+ *
68
+ * **Visual transitions:**
69
+ * - `ColorTint` - Tint the button image with state colors
70
+ * - `Animation` - Trigger animator states for each button state
71
+ * - `SpriteSwap` - Swap sprites for each state (not fully supported)
72
+ *
73
+ * **Requirements:**
74
+ * - Typically paired with an {@link Image} component for visuals or any 3D object
75
+ *
76
+ * @example Listen to button clicks
77
+ * ```ts
78
+ * const button = myButton.getComponent(Button);
79
+ * button.onClick.addEventListener(() => {
80
+ * console.log("Button clicked!");
81
+ * });
82
+ * ```
83
+ *
84
+ * @example Programmatically click a button
85
+ * ```ts
86
+ * button.click(); // Triggers onClick event
87
+ * ```
88
+ *
67
89
  * @summary UI Button that can be clicked to perform actions
68
90
  * @category User Interface
69
91
  * @group Components
92
+ * @see {@link EventList} for onClick callback handling
93
+ * @see {@link Image} for button visuals
94
+ * @see {@link GraphicRaycaster} for UI interaction
95
+ * @see {@link Transition} for visual state options
70
96
  */
71
97
  export class Button extends Behaviour implements IPointerEventHandler {
72
98
 
@@ -25,13 +25,38 @@ export enum RenderMode {
25
25
  const debugLayout = getParam("debuguilayout");
26
26
 
27
27
  /**
28
- * Canvas is the root component for all UI elements in a scene.
29
- * It defines the area where UI elements are rendered and manages their layout and rendering settings.
30
- * Canvases can be set to render in world space or screen space (overlay or camera).
31
- * Multiple canvases can exist in a scene, each with its own settings and hierarchy of UI elements.
28
+ * [Canvas](https://engine.needle.tools/docs/api/Canvas) is the root component for all UI elements in a scene.
29
+ * Defines the rendering area and manages layout for child UI elements.
30
+ *
31
+ * **Render modes:**
32
+ * - `WorldSpace` - UI exists in 3D space, can be viewed from any angle
33
+ * - `ScreenSpaceOverlay` - UI rendered on top of everything (HUD)
34
+ * - `ScreenSpaceCamera` - UI rendered at a distance from a specific camera
35
+ *
36
+ * **Usage:**
37
+ * All UI components ({@link Button}, {@link Text}, {@link Image}) must be
38
+ * children of a Canvas to render correctly. Multiple canvases can exist
39
+ * in a scene with different settings.
40
+ *
41
+ * **Rendering options:**
42
+ * - `renderOnTop` - Always render above other objects
43
+ * - `depthWrite` - Write to depth buffer (affects occlusion)
44
+ * - `doubleSided` - Render both sides of UI elements
45
+ *
46
+ * @example Create a world-space UI panel
47
+ * ```ts
48
+ * const canvas = panel.getComponent(Canvas);
49
+ * canvas.renderMode = RenderMode.WorldSpace;
50
+ * canvas.doubleSided = true;
51
+ * ```
52
+ *
32
53
  * @summary Root component for UI elements, managing layout and rendering settings
33
54
  * @category User Interface
34
55
  * @group Components
56
+ * @see {@link RenderMode} for rendering options
57
+ * @see {@link RectTransform} for UI layout
58
+ * @see {@link Button} for clickable UI elements
59
+ * @see {@link Text} for UI text rendering
35
60
  */
36
61
  export class Canvas extends UIRootComponent implements ICanvas {
37
62
 
@@ -7,8 +7,8 @@ import { type ICanvasGroup, type IHasAlphaFactor } from "./Interfaces.js";
7
7
 
8
8
 
9
9
  /**
10
- * CanvasGroup is a UI component that allows you to control the transparency and interactivity of a group of UI elements.
11
- * By adjusting the alpha property, you can fade in or out all child UI elements simultaneously.
10
+ * [CanvasGroup](https://engine.needle.tools/docs/api/CanvasGroup) is a UI component that allows you to control the transparency and interactivity of a group of UI elements.
11
+ * By adjusting the alpha property, you can fade in or out all child UI elements simultaneously.
12
12
  * The interactable and blocksRaycasts properties let you enable or disable user interaction for the entire group.
13
13
  * @summary Group UI elements to control transparency and interactivity
14
14
  * @category User Interface
@@ -36,7 +36,7 @@ onInitialized((ctx) => {
36
36
  })
37
37
 
38
38
  /**
39
- * The EventSystem is responsible for managing and dispatching input events to UI components within the scene.
39
+ * [EventSystem](https://engine.needle.tools/docs/api/EventSystem) is responsible for managing and dispatching input events to UI components within the scene.
40
40
  * @summary Manages and dispatches input events to UI components
41
41
  * @category User Interface
42
42
  * @group Components
@@ -22,6 +22,7 @@ const _colorStateObject: { backgroundColor: Color, backgroundOpacity: number, bo
22
22
  };
23
23
 
24
24
  /**
25
+ * [Graphic](https://engine.needle.tools/docs/api/Graphic) provides basic rendering for UI elements with color, opacity, and texture support.
25
26
  * @category User Interface
26
27
  * @group Components
27
28
  */
@@ -12,12 +12,31 @@ class Sprite {
12
12
  }
13
13
 
14
14
  /**
15
- * Image is a UI component that displays a sprite (2D image) in the user interface.
16
- * You can set the image property to assign a texture to be displayed.
17
- * The sprite can be customized with various properties such as color tinting and pixel density.
15
+ * [Image](https://engine.needle.tools/docs/api/Image) displays a sprite (2D texture) in the UI. Can be used for icons,
16
+ * backgrounds, or any visual element that needs a texture.
17
+ *
18
+ * **Properties:**
19
+ * - `image` - Direct texture assignment (convenience property)
20
+ * - `sprite` - Sprite object containing texture and rect info
21
+ * - `color` - Tint color applied to the image (inherited from Graphic)
22
+ *
23
+ * **Usage with Button:**
24
+ * Image is commonly paired with {@link Button} to create clickable
25
+ * UI elements with visual feedback via color tinting.
26
+ *
27
+ * @example Set an image texture
28
+ * ```ts
29
+ * const img = myIcon.getComponent(Image);
30
+ * img.image = myTexture;
31
+ * img.color = new RGBAColor(1, 0.5, 0.5, 1); // Red tint
32
+ * ```
33
+ *
18
34
  * @summary Display a 2D image in the UI
19
35
  * @category User Interface
20
36
  * @group Components
37
+ * @see {@link Canvas} for the UI root
38
+ * @see {@link Button} for clickable images
39
+ * @see {@link RawImage} for non-UI image display
21
40
  */
22
41
  export class Image extends MaskableGraphic {
23
42
 
@@ -10,8 +10,8 @@ import { tryGetUIComponent } from "./Utils.js";
10
10
  const debug = getParam("debuginputfield");
11
11
 
12
12
  /**
13
- * InputField is a UI component that allows users to enter and edit text.
14
- * It provides a text input area where users can type, delete, and modify text.
13
+ * [InputField](https://engine.needle.tools/docs/api/InputField) is a UI component that allows users to enter and edit text.
14
+ * It provides a text input area where users can type, delete, and modify text.
15
15
  * The InputField supports placeholder text, events for value changes, and end edit actions.
16
16
  * @summary Text field for user input
17
17
  * @category User Interface
@@ -301,6 +301,7 @@ export abstract class HorizontalOrVerticalLayoutGroup extends LayoutGroup {
301
301
  }
302
302
 
303
303
  /**
304
+ * [VerticalLayoutGroup](https://engine.needle.tools/docs/api/VerticalLayoutGroup) arranges child UI elements vertically with spacing, padding, and alignment options.
304
305
  * @category User Interface
305
306
  * @group Components
306
307
  */
@@ -313,6 +314,7 @@ export class VerticalLayoutGroup extends HorizontalOrVerticalLayoutGroup {
313
314
  }
314
315
 
315
316
  /**
317
+ * [HorizontalLayoutGroup](https://engine.needle.tools/docs/api/HorizontalLayoutGroup) arranges child UI elements horizontally with spacing, padding, and alignment options.
316
318
  * @category User Interface
317
319
  * @group Components
318
320
  */
@@ -325,6 +327,7 @@ export class HorizontalLayoutGroup extends HorizontalOrVerticalLayoutGroup {
325
327
  }
326
328
 
327
329
  /**
330
+ * [GridLayoutGroup](https://engine.needle.tools/docs/api/GridLayoutGroup) arranges child UI elements in a grid pattern.
328
331
  * @category User Interface
329
332
  * @group Components
330
333
  */
@@ -5,7 +5,7 @@ import { RGBAColor } from "../../engine/js-extensions/index.js";
5
5
  import { Behaviour } from "../Component.js";
6
6
 
7
7
  /**
8
- * Outline is a UI component that adds an outline effect to UI elements.
8
+ * [Outline](https://engine.needle.tools/docs/api/Outline) is a UI component that adds an outline effect to UI elements.
9
9
  * You can customize the outline color and distance to create a visual border around the UI element.
10
10
  * @summary Add an outline effect to UI elements
11
11
  * @category User Interface
@@ -10,7 +10,7 @@ export interface IInputEventArgs {
10
10
  stopImmediatePropagation?(): void;
11
11
  }
12
12
 
13
- /** This pointer event data object is passed to all event receivers that are currently active
13
+ /** [PointerEventData](https://engine.needle.tools/docs/api/PointerEventData) This pointer event data object is passed to all event receivers that are currently active
14
14
  * It contains hit information if an object was hovered or clicked
15
15
  * If the event is received in onPointerDown or onPointerMove, you can call `setPointerCapture` to receive onPointerMove events even when the pointer has left the object until you call `releasePointerCapture` or when the pointerUp event happens
16
16
  * You can get additional information about the event or event source via the `event` property (of type `NEPointerEvent`)
@@ -7,9 +7,21 @@ import { Behaviour } from "../Component.js";
7
7
  import { EventSystem } from "./EventSystem.js";
8
8
 
9
9
 
10
- /** Derive from this class to create your own custom Raycaster
11
- * If you override awake, onEnable or onDisable, be sure to call the base class methods
12
- * Implement `performRaycast` to perform your custom raycasting logic
10
+ /**
11
+ * [ObjectRaycaster](https://engine.needle.tools/docs/api/ObjectRaycaster) Base class for raycasters that detect pointer interactions.
12
+ * Derive from this class to create custom raycasting logic.
13
+ *
14
+ * **Built-in raycasters:**
15
+ * - {@link ObjectRaycaster} - Raycasts against 3D objects
16
+ * - {@link GraphicRaycaster} - Raycasts against UI elements
17
+ * - {@link SpatialGrabRaycaster} - Sphere overlap for XR grab
18
+ *
19
+ * **Important:** If you override `awake`, `onEnable`, or `onDisable`,
20
+ * call the base class methods to ensure proper registration with {@link EventSystem}.
21
+ *
22
+ * @category Interactivity
23
+ * @group Components
24
+ * @see {@link EventSystem} for the event dispatch system
13
25
  */
14
26
  export abstract class Raycaster extends Behaviour {
15
27
  awake(): void {
@@ -29,10 +41,22 @@ export abstract class Raycaster extends Behaviour {
29
41
 
30
42
 
31
43
  /**
32
- * A Raycaster that performs raycasting against its own GameObject.
44
+ * ObjectRaycaster enables pointer interactions with 3D objects.
45
+ * Add this component to any object that needs click/hover detection.
46
+ *
47
+ * **Usage:**
48
+ * Objects with ObjectRaycaster will receive pointer events when
49
+ * they implement interfaces like {@link IPointerClickHandler}.
33
50
  *
51
+ * **Note:**
52
+ * In older Needle Engine versions the ObjectRaycaster was required to be added to the Scene.
53
+ * This is no longer the case - the EventSystem will automatically handle raycasts.
54
+ *
55
+ *
34
56
  * @category Interactivity
35
57
  * @group Components
58
+ * @see {@link IPointerClickHandler} for click events
59
+ * @see {@link DragControls} for drag interactions
36
60
  */
37
61
  export class ObjectRaycaster extends Raycaster {
38
62
  private targets: Object3D[] | null = null;
@@ -73,11 +97,27 @@ export class ObjectRaycaster extends Raycaster {
73
97
 
74
98
 
75
99
  /**
76
- * A Raycaster that performs raycasting against UI elements (objects with a CanvasRenderer component).
77
- *
100
+ * GraphicRaycaster enables pointer interactions with UI elements.
101
+ * Add this to a {@link Canvas} or UI hierarchy to enable button clicks,
102
+ * hover effects, and other UI interactions.
103
+ *
104
+ * **Requirements:**
105
+ * - Must be on the same object as a Canvas or on a parent
106
+ * - UI elements need proper RectTransform setup
107
+ *
108
+ * @example Enable UI interaction
109
+ * ```ts
110
+ * // Add to Canvas object
111
+ * canvas.addComponent(GraphicRaycaster);
112
+ * // Now buttons and other UI elements will respond to clicks
113
+ * ```
114
+ *
78
115
  * @summary Raycaster for UI elements
79
116
  * @category User Interface
80
117
  * @group Components
118
+ * @see {@link Canvas} for UI root
119
+ * @see {@link Button} for clickable UI
120
+ * @see {@link EventSystem} for event handling
81
121
  */
82
122
  export class GraphicRaycaster extends ObjectRaycaster {
83
123
  // eventCamera: Camera | null = null;
@@ -91,10 +131,19 @@ export class GraphicRaycaster extends ObjectRaycaster {
91
131
  }
92
132
 
93
133
  /**
94
- * A Raycaster that performs sphere overlap raycasting for spatial grab interactions in XR.
95
- *
134
+ * SpatialGrabRaycaster enables direct grab interactions in VR/AR.
135
+ * Uses sphere overlap detection around the controller/hand position
136
+ * to allow grabbing objects by reaching into them.
137
+ *
138
+ * **Features:**
139
+ * - Active only during XR sessions
140
+ * - Can be globally disabled via `SpatialGrabRaycaster.allow`
141
+ * - Works alongside ray-based interaction
142
+ *
96
143
  * @category XR
97
144
  * @group Components
145
+ * @see {@link WebXR} for XR session management
146
+ * @see {@link DragControls} for object manipulation
98
147
  */
99
148
  export class SpatialGrabRaycaster extends Raycaster {
100
149
 
@@ -29,8 +29,8 @@ const tempVec = new Vector3();
29
29
  const tempMatrix = new Matrix4();
30
30
  const tempQuaternion = new Quaternion();
31
31
 
32
- /**
33
- * RectTransform is a component that defines a rectangle for UI layout.
32
+ /**
33
+ * [RectTransform](https://engine.needle.tools/docs/api/RectTransform) defines a rectangle for UI layout with anchoring, pivoting, and positioning capabilities.
34
34
  * @summary UI Rectangle Transform
35
35
  * @category User Interface
36
36
  * @group Components
@@ -7,7 +7,7 @@ import { getWorldRotation, setWorldRotationXYZ } from '../../engine/engine_three
7
7
  import { Behaviour } from '../Component.js';
8
8
 
9
9
  /**
10
- * SpatialHtml is a component that allows you to integrate HTML elements into a 3D scene.
10
+ * [SpatialHtml](https://engine.needle.tools/docs/api/SpatialHtml) is a component that allows you to integrate HTML elements into a 3D scene.
11
11
  * By specifying the ID of an existing HTML element, you can render it as a 3D object within the scene.
12
12
  * @summary Render HTML elements as 3D objects in the scene
13
13
  * @category User Interface
@@ -40,11 +40,33 @@ export enum FontStyle {
40
40
  }
41
41
 
42
42
  /**
43
- * Text is a UI component that displays text in the user interface.
44
- *
43
+ * [Text](https://engine.needle.tools/docs/api/Text) displays text content in the UI. Supports custom fonts, colors,
44
+ * alignment, and basic rich text formatting.
45
+ *
46
+ * **Text properties:**
47
+ * - `text` - The string content to display
48
+ * - `fontSize` - Size of the text in pixels
49
+ * - `color` - Text color (inherited from Graphic)
50
+ * - `alignment` - Text anchor position (UpperLeft, MiddleCenter, etc.)
51
+ *
52
+ * **Fonts:**
53
+ * Set the `font` property to a URL pointing to a font file.
54
+ * Supports MSDF (Multi-channel Signed Distance Field) fonts for crisp rendering.
55
+ *
56
+ * @example Update text at runtime
57
+ * ```ts
58
+ * const text = myLabel.getComponent(Text);
59
+ * text.text = "Score: " + score;
60
+ * text.fontSize = 24;
61
+ * text.color = new RGBAColor(1, 1, 1, 1);
62
+ * ```
63
+ *
45
64
  * @summary Display text in the UI
46
65
  * @category User Interface
47
66
  * @group Components
67
+ * @see {@link Canvas} for the UI root
68
+ * @see {@link TextAnchor} for alignment options
69
+ * @see {@link FontStyle} for bold/italic styles
48
70
  */
49
71
  export class Text extends Graphic implements IHasAlphaFactor, ICanvasEventReceiver {
50
72
 
@@ -9,7 +9,7 @@ import { USDObject } from "../../engine-components/export/usdz/ThreeUSDZExporter
9
9
  import { Behaviour } from "../Component.js";
10
10
 
11
11
  /**
12
- * LookAt behaviour makes the object look at a target object or the camera.
12
+ * The [LookAt](https://engine.needle.tools/docs/api/LookAt) behaviour makes the object look at a target object or the camera.
13
13
  * It can also invert the forward direction and keep the up direction.
14
14
  *
15
15
  * @summary Makes the object look at a target object or the camera
@@ -7,7 +7,7 @@ import { type IPointerClickHandler, PointerEventData } from "../ui/index.js";
7
7
  import { ObjectRaycaster } from "../ui/Raycaster.js";
8
8
 
9
9
  /**
10
- * OpenURLMode defines how a URL should be opened.
10
+ * [OpenURL](https://engine.needle.tools/docs/api/OpenURL) OpenURLMode defines how a URL should be opened.
11
11
  */
12
12
  export enum OpenURLMode {
13
13
  NewTab = 0,