@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
@@ -5,19 +5,48 @@ import { Mathf } from "../../engine/engine_math.js";
5
5
  import { serializeable } from "../../engine/engine_serialization.js";
6
6
  import { getParam } from "../../engine/engine_utils.js";
7
7
  import { Behaviour } from "../Component.js";
8
+ import type { SplineWalker } from "./index.js";
8
9
 
9
10
  const debug = getParam("debugsplines");
10
11
 
12
+ /**
13
+ * Represents a single knot (control point) in a spline curve.
14
+ *
15
+ * Each knot defines a point along the spline with its position, rotation, and tangent handles
16
+ * that control the curve's shape entering and leaving the knot.
17
+ *
18
+ * **Properties:**
19
+ * - **position**: The 3D position of this knot in local space
20
+ * - **rotation**: The orientation at this knot (useful for rotating objects along the spline)
21
+ * - **tangentIn**: The incoming tangent handle controlling the curve shape before this knot
22
+ * - **tangentOut**: The outgoing tangent handle controlling the curve shape after this knot
23
+ *
24
+ * @see {@link SplineContainer} for the container that holds and manages multiple knots
25
+ */
11
26
  export class SplineData {
27
+ /**
28
+ * The 3D position of this knot in local space relative to the SplineContainer.
29
+ */
12
30
  @serializeable(Vector3)
13
31
  position: Vector3 = new Vector3();
14
32
 
33
+ /**
34
+ * The orientation at this knot. Can be used to rotate objects following the spline.
35
+ */
15
36
  @serializeable(Quaternion)
16
37
  rotation: Quaternion = new Quaternion();
17
38
 
39
+ /**
40
+ * The incoming tangent handle controlling the curve shape as it approaches this knot.
41
+ * The magnitude and direction affect the smoothness and curvature of the spline.
42
+ */
18
43
  @serializeable(Vector3)
19
44
  tangentIn: Vector3 = new Vector3();
20
45
 
46
+ /**
47
+ * The outgoing tangent handle controlling the curve shape as it leaves this knot.
48
+ * The magnitude and direction affect the smoothness and curvature of the spline.
49
+ */
21
50
  @serializeable(Vector3)
22
51
  tangentOut: Vector3 = new Vector3();
23
52
  }
@@ -32,19 +61,162 @@ export class SplineData {
32
61
 
33
62
  //@dont-generate-component
34
63
  /**
35
- * Holds spline data and generates a spline curve. Use with SplineWalker to move objects along the spline or call getPointAt to sample points on the spline.
36
- * The spline is defined by an array of knots (SplineData) which define position, rotation and tangents.
37
- *
38
- * You can create a SplineContainer from an array of points using the static method 'createFromPoints'.
39
- *
40
- * @summary Holds spline data and generates a spline curve.
64
+ * [SplineContainer](https://engine.needle.tools/docs/api/SplineContainer) manages spline curves defined by a series of knots (control points).
65
+ * This component stores spline data and generates smooth curves that can be used for animation paths, camera paths, racing tracks, or any curved path in 3D space.
66
+ *
67
+ * ![](https://cloud.needle.tools/-/media/XIHaiNFsA1IbMZVJepp1aQ.gif)
68
+ *
69
+ * **How It Works:**
70
+ * The spline is defined by an array of {@link SplineData} knots. Each knot contains:
71
+ * - **Position**: The location of the control point
72
+ * - **Rotation**: Orientation at that point (useful for banking/tilting objects along the path)
73
+ * - **Tangents**: Handles that control the curve's smoothness and shape
74
+ *
75
+ * The component uses Catmull-Rom interpolation to create smooth curves between knots. The curve is automatically
76
+ * rebuilt when knots are added, removed, or marked dirty, and all sampling methods return positions in world space.
77
+ *
78
+ * **Key Features:**
79
+ * - Smooth Catmull-Rom curve interpolation
80
+ * - Support for open and closed curves
81
+ * - Dynamic knot management (add/remove at runtime)
82
+ * - World-space sampling with {@link getPointAt} and {@link getTangentAt}
83
+ * - Automatic curve regeneration when modified
84
+ * - Built-in debug visualization
85
+ * - Integrates seamlessly with {@link SplineWalker}
86
+ *
87
+ * **Common Use Cases:**
88
+ * - Camera paths and cinematics
89
+ * - Object movement along curved paths
90
+ * - Racing game tracks and racing lines
91
+ * - Character patrol routes
92
+ * - Procedural road/path generation
93
+ * - Animation curves for complex motion
94
+ * - Cable/rope visualization
95
+ *
96
+ * @example Basic spline setup with knots
97
+ * ```ts
98
+ * const splineObj = new Object3D();
99
+ * const spline = splineObj.addComponent(SplineContainer);
100
+ *
101
+ * // Add knots to define the path
102
+ * spline.addKnot({ position: new Vector3(0, 0, 0) });
103
+ * spline.addKnot({ position: new Vector3(2, 1, 0) });
104
+ * spline.addKnot({ position: new Vector3(4, 0, 2) });
105
+ * spline.addKnot({ position: new Vector3(6, -1, 1) });
106
+ *
107
+ * // Sample a point halfway along the spline
108
+ * const midpoint = spline.getPointAt(0.5);
109
+ * console.log("Midpoint:", midpoint);
110
+ * ```
111
+ *
112
+ * @example Creating a closed loop spline
113
+ * ```ts
114
+ * const loopSpline = gameObject.addComponent(SplineContainer);
115
+ * loopSpline.closed = true; // Makes the spline loop back to the start
116
+ *
117
+ * // Add circular path knots
118
+ * for (let i = 0; i < 8; i++) {
119
+ * const angle = (i / 8) * Math.PI * 2;
120
+ * const pos = new Vector3(Math.cos(angle) * 5, 0, Math.sin(angle) * 5);
121
+ * loopSpline.addKnot({ position: pos });
122
+ * }
123
+ * ```
124
+ *
125
+ * @example Sampling points along a spline
126
+ * ```ts
127
+ * const spline = gameObject.getComponent(SplineContainer);
128
+ *
129
+ * // Sample 10 points along the spline
130
+ * const points: Vector3[] = [];
131
+ * for (let i = 0; i <= 10; i++) {
132
+ * const t = i / 10; // 0 to 1
133
+ * const point = spline.getPointAt(t);
134
+ * points.push(point);
135
+ * }
136
+ *
137
+ * // Get tangent (direction) at 75% along the spline
138
+ * const tangent = spline.getTangentAt(0.75);
139
+ * console.log("Direction at 75%:", tangent);
140
+ * ```
141
+ *
142
+ * @example Dynamic knot manipulation
143
+ * ```ts
144
+ * const spline = gameObject.getComponent(SplineContainer);
145
+ *
146
+ * // Add a new knot dynamically
147
+ * const newKnot = new SplineData();
148
+ * newKnot.position.set(10, 5, 0);
149
+ * spline.addKnot(newKnot);
150
+ *
151
+ * // Remove the first knot
152
+ * spline.removeKnot(0);
153
+ *
154
+ * // Modify existing knot
155
+ * spline.spline[1].position.y += 2;
156
+ * spline.markDirty(); // Tell the spline to rebuild
157
+ * ```
158
+ *
159
+ * @example Using with SplineWalker for animation
160
+ * ```ts
161
+ * // Set up spline path
162
+ * const spline = pathObject.addComponent(SplineContainer);
163
+ * spline.addKnot({ position: new Vector3(0, 0, 0) });
164
+ * spline.addKnot({ position: new Vector3(5, 2, 5) });
165
+ * spline.addKnot({ position: new Vector3(10, 0, 0) });
166
+ *
167
+ * // Make object follow the spline
168
+ * const walker = movingObject.addComponent(SplineWalker);
169
+ * walker.spline = spline;
170
+ * walker.speed = 2; // Units per second
171
+ * walker.loop = true;
172
+ * ```
173
+ *
174
+ * **Debug Visualization:**
175
+ * Add `?debugsplines` to your URL to enable debug visualization, which draws the spline curve as a purple line.
176
+ * You can also enable it programmatically:
177
+ * ```ts
178
+ * spline.debug = true; // Show debug visualization
179
+ * ```
180
+ *
181
+ * @see {@link SplineWalker} - Component for moving objects along a spline path
182
+ * @see {@link SplineData} - The knot data structure used to define spline points
183
+ * @see {@link getPointAt} - Sample positions along the spline
184
+ * @see {@link getTangentAt} - Get direction vectors along the spline
185
+ * @see {@link addKnot} - Add control points to the spline
186
+ * @see {@link removeKnot} - Remove control points from the spline
187
+ *
188
+ * @summary Manages smooth spline curves defined by control point knots
41
189
  * @category Splines
42
190
  * @group Components
191
+ * @component
43
192
  */
44
193
  export class SplineContainer extends Behaviour {
45
194
 
46
195
  /**
47
- * Adds a knot to the end of the spline.
196
+ * Adds a knot (control point) to the end of the spline.
197
+ *
198
+ * You can pass either a full {@link SplineData} object or a simple object with just a position.
199
+ * When passing a simple object, default values are used for rotation and tangents.
200
+ *
201
+ * The spline curve is automatically marked dirty and will be rebuilt on the next update.
202
+ *
203
+ * @param knot - Either a SplineData object or an object with at least a `position` property
204
+ * @returns This SplineContainer for method chaining
205
+ *
206
+ * @example Add knots with positions only
207
+ * ```ts
208
+ * spline.addKnot({ position: new Vector3(0, 0, 0) })
209
+ * .addKnot({ position: new Vector3(5, 0, 0) })
210
+ * .addKnot({ position: new Vector3(5, 0, 5) });
211
+ * ```
212
+ *
213
+ * @example Add a full SplineData knot
214
+ * ```ts
215
+ * const knot = new SplineData();
216
+ * knot.position.set(10, 2, 5);
217
+ * knot.rotation.setFromEuler(new Euler(0, Math.PI / 4, 0));
218
+ * spline.addKnot(knot);
219
+ * ```
48
220
  */
49
221
  addKnot(knot: SplineData | { position: Vector3 }): SplineContainer {
50
222
  if (knot instanceof SplineData) {
@@ -61,7 +233,27 @@ export class SplineContainer extends Behaviour {
61
233
  }
62
234
 
63
235
  /**
64
- * Removes a knot by index or by reference.
236
+ * Removes a knot (control point) from the spline.
237
+ *
238
+ * You can remove a knot either by its numeric index in the spline array or by passing
239
+ * a reference to the SplineData object itself.
240
+ *
241
+ * The spline curve is automatically marked dirty and will be rebuilt on the next update.
242
+ *
243
+ * @param index - Either the numeric index of the knot to remove, or the SplineData object reference
244
+ * @returns This SplineContainer for method chaining
245
+ *
246
+ * @example Remove knot by index
247
+ * ```ts
248
+ * spline.removeKnot(0); // Remove first knot
249
+ * spline.removeKnot(spline.spline.length - 1); // Remove last knot
250
+ * ```
251
+ *
252
+ * @example Remove knot by reference
253
+ * ```ts
254
+ * const knotToRemove = spline.spline[2];
255
+ * spline.removeKnot(knotToRemove);
256
+ * ```
65
257
  */
66
258
  removeKnot(index: number | SplineData): SplineContainer {
67
259
  if (typeof index === "number") {
@@ -78,7 +270,40 @@ export class SplineContainer extends Behaviour {
78
270
  }
79
271
 
80
272
  /**
81
- * Gets a point on the spline in world space.
273
+ * Samples a point on the spline at a given parametric position (in world space).
274
+ *
275
+ * The parameter `t` ranges from 0 to 1, where:
276
+ * - `0` = start of the spline
277
+ * - `0.5` = middle of the spline
278
+ * - `1` = end of the spline
279
+ *
280
+ * The returned position is in world space, accounting for the SplineContainer's transform.
281
+ * Values outside 0-1 are clamped to the valid range.
282
+ *
283
+ * @param t - Parametric position along the spline (0 to 1)
284
+ * @param target - Optional Vector3 to store the result (avoids allocation)
285
+ * @returns The world-space position at parameter `t`
286
+ *
287
+ * @example Sample multiple points along the spline
288
+ * ```ts
289
+ * // Sample 20 evenly-spaced points
290
+ * const points: Vector3[] = [];
291
+ * for (let i = 0; i <= 20; i++) {
292
+ * const t = i / 20;
293
+ * points.push(spline.getPointAt(t));
294
+ * }
295
+ * ```
296
+ *
297
+ * @example Using a target vector for efficiency
298
+ * ```ts
299
+ * const reusableVector = new Vector3();
300
+ * for (let i = 0; i < 100; i++) {
301
+ * const point = spline.getPointAt(i / 100, reusableVector);
302
+ * // Use point...
303
+ * }
304
+ * ```
305
+ *
306
+ * @see {@link getTangentAt} to get the direction at a point
82
307
  */
83
308
  getPointAt(t: number, target?: Vector3): Vector3 {
84
309
  if (!this.curve) return new Vector3();
@@ -91,14 +316,80 @@ export class SplineContainer extends Behaviour {
91
316
  }
92
317
 
93
318
  /**
94
- * Marks the spline as dirty, causing it to be rebuilt on the next update.
319
+ * Marks the spline as dirty, causing it to be rebuilt on the next update frame.
320
+ *
321
+ * Call this method whenever you manually modify the spline data (knot positions, rotations, or tangents)
322
+ * to ensure the curve is regenerated. This is done automatically when using {@link addKnot} or {@link removeKnot}.
323
+ *
324
+ * @example Modifying knots and marking dirty
325
+ * ```ts
326
+ * // Modify existing knot positions
327
+ * spline.spline[0].position.y += 2;
328
+ * spline.spline[1].position.x -= 1;
329
+ *
330
+ * // Tell the spline to rebuild
331
+ * spline.markDirty();
332
+ * ```
333
+ *
334
+ * @example Animating knot positions
335
+ * ```ts
336
+ * update() {
337
+ * const time = this.context.time.time;
338
+ * // Animate knot positions
339
+ * for (let i = 0; i < spline.spline.length; i++) {
340
+ * spline.spline[i].position.y = Math.sin(time + i) * 2;
341
+ * }
342
+ * spline.markDirty(); // Rebuild curve each frame
343
+ * }
344
+ * ```
95
345
  */
96
346
  markDirty() {
97
347
  this._isDirty = true;
98
348
  }
99
349
 
100
350
  /**
101
- * Gets the tangent vector on the spline in world space.
351
+ * Samples the tangent (direction) vector on the spline at a given parametric position (in world space).
352
+ *
353
+ * The tangent represents the forward direction of the curve at point `t`. This is useful for:
354
+ * - Orienting objects along the spline (facing the direction of travel)
355
+ * - Calculating banking/tilting for vehicles on the path
356
+ * - Understanding the curve's direction at any point
357
+ *
358
+ * The parameter `t` ranges from 0 to 1 (same as {@link getPointAt}).
359
+ * The returned vector is normalized and in world space, accounting for the SplineContainer's rotation.
360
+ *
361
+ * @param t - Parametric position along the spline (0 to 1)
362
+ * @param target - Optional Vector3 to store the result (avoids allocation)
363
+ * @returns The normalized tangent vector in world space at parameter `t`
364
+ *
365
+ * @example Orient an object along the spline
366
+ * ```ts
367
+ * const position = spline.getPointAt(0.5);
368
+ * const tangent = spline.getTangentAt(0.5);
369
+ *
370
+ * object.position.copy(position);
371
+ * object.lookAt(position.clone().add(tangent)); // Face along the spline
372
+ * ```
373
+ *
374
+ * @example Calculate velocity direction for a moving object
375
+ * ```ts
376
+ * let t = 0;
377
+ * update() {
378
+ * t += this.context.time.deltaTime * 0.2; // Speed
379
+ * if (t > 1) t = 0; // Loop
380
+ *
381
+ * const pos = spline.getPointAt(t);
382
+ * const direction = spline.getTangentAt(t);
383
+ *
384
+ * movingObject.position.copy(pos);
385
+ * movingObject.quaternion.setFromUnitVectors(
386
+ * new Vector3(0, 0, 1),
387
+ * direction
388
+ * );
389
+ * }
390
+ * ```
391
+ *
392
+ * @see {@link getPointAt} to get the position at a point
102
393
  */
103
394
  getTangentAt(t: number, target?: Vector3): Vector3 {
104
395
  if (!this.curve) return target ?? new Vector3();
@@ -106,6 +397,36 @@ export class SplineContainer extends Behaviour {
106
397
  return this.curve.getTangentAt(Mathf.clamp01(t), target).applyQuaternion(wr);
107
398
  }
108
399
 
400
+ /**
401
+ * Whether the spline forms a closed loop.
402
+ *
403
+ * **When `true`:**
404
+ * - The spline connects the last knot back to the first knot, forming a continuous loop
405
+ * - Perfect for racing tracks, patrol routes, or any circular path
406
+ * - Parameter `t=1` will smoothly connect back to `t=0`
407
+ *
408
+ * **When `false` (default):**
409
+ * - The spline is open, with distinct start and end points
410
+ * - Suitable for one-way paths, camera movements, or linear progressions
411
+ *
412
+ * Changing this property marks the spline as dirty and triggers a rebuild.
413
+ *
414
+ * @example Create a circular patrol route
415
+ * ```ts
416
+ * const patrol = gameObject.addComponent(SplineContainer);
417
+ * patrol.closed = true; // Loop back to start
418
+ *
419
+ * // Add points in a circle
420
+ * for (let i = 0; i < 8; i++) {
421
+ * const angle = (i / 8) * Math.PI * 2;
422
+ * patrol.addKnot({
423
+ * position: new Vector3(Math.cos(angle) * 10, 0, Math.sin(angle) * 10)
424
+ * });
425
+ * }
426
+ * ```
427
+ *
428
+ * @default false
429
+ */
109
430
  @serializeable()
110
431
  set closed(value: boolean) {
111
432
  this._closed = value;
@@ -115,22 +436,99 @@ export class SplineContainer extends Behaviour {
115
436
  private _closed: boolean = false;
116
437
 
117
438
 
118
- /** Spline data. Call 'markDirty' if modified */
439
+ /**
440
+ * Array of knots (control points) that define the spline curve.
441
+ *
442
+ * Each element is a {@link SplineData} object containing position, rotation, and tangent information.
443
+ * You can directly access and modify this array, but remember to call {@link markDirty} afterwards
444
+ * to trigger a curve rebuild.
445
+ *
446
+ * **Best practices:**
447
+ * - Use {@link addKnot} and {@link removeKnot} methods for automatic dirty marking
448
+ * - If modifying knots directly, always call {@link markDirty} afterwards
449
+ * - The order of knots determines the path direction
450
+ *
451
+ * @example Direct array access
452
+ * ```ts
453
+ * console.log(`Spline has ${spline.spline.length} knots`);
454
+ *
455
+ * // Access first knot
456
+ * const firstKnot = spline.spline[0];
457
+ * console.log("Start position:", firstKnot.position);
458
+ *
459
+ * // Modify and mark dirty
460
+ * spline.spline[2].position.y += 5;
461
+ * spline.markDirty();
462
+ * ```
463
+ *
464
+ * @see {@link SplineData} for the knot data structure
465
+ * @see {@link addKnot} for adding knots (auto marks dirty)
466
+ * @see {@link removeKnot} for removing knots (auto marks dirty)
467
+ * @see {@link markDirty} to trigger rebuild after manual modifications
468
+ */
119
469
  @serializeable(SplineData)
120
470
  spline: SplineData[] = [];
121
471
 
122
- /** Enable to render the spline curve for debugging */
472
+ /**
473
+ * Enables visual debug rendering of the spline curve.
474
+ *
475
+ * When enabled, the spline is rendered as a purple line in the scene, making it easy to
476
+ * visualize the path during development. The debug line automatically updates when the spline is modified.
477
+ *
478
+ * **Debug visualization:**
479
+ * - Purple line showing the complete curve path
480
+ * - Automatically rebuilds when spline changes
481
+ * - Line resolution based on number of knots (10 segments per knot)
482
+ *
483
+ * **Tip:** You can also enable debug visualization globally for all splines by adding `?debugsplines`
484
+ * to your URL.
485
+ *
486
+ * @example Enable debug visualization
487
+ * ```ts
488
+ * const spline = gameObject.addComponent(SplineContainer);
489
+ * spline.debug = true; // Show purple debug line
490
+ *
491
+ * // Add some knots to see the visualization
492
+ * spline.addKnot({ position: new Vector3(0, 0, 0) });
493
+ * spline.addKnot({ position: new Vector3(5, 2, 0) });
494
+ * spline.addKnot({ position: new Vector3(10, 0, 5) });
495
+ * ```
496
+ */
123
497
  set debug(debug: boolean) {
124
498
  if (debug && !this._builtCurve) this.buildCurve();
125
499
  if (!this._debugLine) return;
126
500
  this._debugLine.visible = debug;
127
501
  }
128
502
 
129
- /** Gets the spline curve generated from the 'spline' data */
503
+ /**
504
+ * The Three.js Curve object generated from the spline knots.
505
+ *
506
+ * This is the underlying curve implementation (typically a CatmullRomCurve3) that's used for
507
+ * all position and tangent sampling. The curve is automatically regenerated when the spline
508
+ * is marked dirty.
509
+ *
510
+ * **Note:** This curve is in local space relative to the SplineContainer. Use {@link getPointAt}
511
+ * and {@link getTangentAt} methods to get world-space results.
512
+ *
513
+ * @returns The generated Three.js Curve, or null if not yet built
514
+ */
130
515
  get curve(): Curve<Vector3> | null {
131
516
  return this._curve;
132
517
  }
133
518
 
519
+ /**
520
+ * Whether the spline needs to be rebuilt due to modifications.
521
+ *
522
+ * The spline is marked dirty when:
523
+ * - Knots are added via {@link addKnot}
524
+ * - Knots are removed via {@link removeKnot}
525
+ * - {@link markDirty} is called manually
526
+ * - The {@link closed} property is changed
527
+ *
528
+ * The curve is automatically rebuilt on the next update frame when dirty.
529
+ *
530
+ * @returns `true` if the spline needs rebuilding, `false` otherwise
531
+ */
134
532
  get isDirty() { return this._isDirty; }
135
533
 
136
534
  private _isDirty: boolean = false;
@@ -5,6 +5,7 @@ import { SplineContainer, SplineData } from "./Spline.js";
5
5
 
6
6
  /**
7
7
  * @category Splines
8
+ * @see {@link SplineContainer} for the main spline component that defines the path and knots
8
9
  */
9
10
  export namespace SplineUtils {
10
11
 
@@ -7,8 +7,10 @@ import { Behaviour } from "../Component.js";
7
7
  import { SplineContainer } from "./Spline.js";
8
8
 
9
9
  /**
10
- * Moves an object along a spline.
11
- * Use this with a SplineContainer component.
10
+ * [SplineWalker](https://engine.needle.tools/docs/api/SplineWalker) Moves an object along a {@link SplineContainer}.
11
+ * Use this with a SplineContainer component.
12
+ *
13
+ * ![](https://cloud.needle.tools/-/media/XIHaiNFsA1IbMZVJepp1aQ.gif)
12
14
  *
13
15
  * - Example http://samples.needle.tools/splines
14
16
  *