@needle-tools/engine 4.13.0 → 4.13.1

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 (428) hide show
  1. package/CHANGELOG.md +8 -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-BNIUpreS.min.js} +107 -107
  6. package/dist/{needle-engine.bundle-Dl3TFYyv.js → needle-engine.bundle-DauZUYl7.js} +2347 -1845
  7. package/dist/{needle-engine.bundle-J4k4znv8.umd.cjs → needle-engine.bundle-tjI5Fq2c.umd.cjs} +108 -108
  8. package/dist/needle-engine.d.ts +4022 -419
  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 +37 -1
  31. package/lib/engine/engine_physics.js +37 -1
  32. package/lib/engine/engine_physics.js.map +1 -1
  33. package/lib/engine/engine_physics_rapier.d.ts +78 -0
  34. package/lib/engine/engine_physics_rapier.js +78 -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 +28 -6
  84. package/lib/engine-components/ContactShadows.js +33 -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 +40 -12
  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 +35 -0
  148. package/lib/engine-components/Renderer.js +36 -2
  149. package/lib/engine-components/Renderer.js.map +1 -1
  150. package/lib/engine-components/RigidBody.d.ts +57 -5
  151. package/lib/engine-components/RigidBody.js +57 -5
  152. package/lib/engine-components/RigidBody.js.map +1 -1
  153. package/lib/engine-components/SceneSwitcher.d.ts +11 -0
  154. package/lib/engine-components/SceneSwitcher.js +11 -0
  155. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  156. package/lib/engine-components/ScreenCapture.d.ts +39 -6
  157. package/lib/engine-components/ScreenCapture.js +39 -6
  158. package/lib/engine-components/ScreenCapture.js.map +1 -1
  159. package/lib/engine-components/SeeThrough.d.ts +70 -5
  160. package/lib/engine-components/SeeThrough.js +70 -5
  161. package/lib/engine-components/SeeThrough.js.map +1 -1
  162. package/lib/engine-components/ShadowCatcher.d.ts +56 -4
  163. package/lib/engine-components/ShadowCatcher.js +56 -4
  164. package/lib/engine-components/ShadowCatcher.js.map +1 -1
  165. package/lib/engine-components/Skybox.d.ts +43 -7
  166. package/lib/engine-components/Skybox.js +43 -7
  167. package/lib/engine-components/Skybox.js.map +1 -1
  168. package/lib/engine-components/SmoothFollow.d.ts +66 -7
  169. package/lib/engine-components/SmoothFollow.js +66 -7
  170. package/lib/engine-components/SmoothFollow.js.map +1 -1
  171. package/lib/engine-components/SpatialTrigger.d.ts +48 -1
  172. package/lib/engine-components/SpatialTrigger.js +48 -1
  173. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  174. package/lib/engine-components/SpectatorCamera.d.ts +21 -3
  175. package/lib/engine-components/SpectatorCamera.js +21 -3
  176. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  177. package/lib/engine-components/SyncedRoom.d.ts +7 -1
  178. package/lib/engine-components/SyncedRoom.js +7 -1
  179. package/lib/engine-components/SyncedRoom.js.map +1 -1
  180. package/lib/engine-components/SyncedTransform.d.ts +55 -6
  181. package/lib/engine-components/SyncedTransform.js +55 -6
  182. package/lib/engine-components/SyncedTransform.js.map +1 -1
  183. package/lib/engine-components/TransformGizmo.d.ts +30 -3
  184. package/lib/engine-components/TransformGizmo.js +30 -3
  185. package/lib/engine-components/TransformGizmo.js.map +1 -1
  186. package/lib/engine-components/VideoPlayer.d.ts +33 -6
  187. package/lib/engine-components/VideoPlayer.js +45 -6
  188. package/lib/engine-components/VideoPlayer.js.map +1 -1
  189. package/lib/engine-components/Voip.d.ts +33 -2
  190. package/lib/engine-components/Voip.js +33 -2
  191. package/lib/engine-components/Voip.js.map +1 -1
  192. package/lib/engine-components/export/usdz/USDZExporter.d.ts +47 -13
  193. package/lib/engine-components/export/usdz/USDZExporter.js +47 -13
  194. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  195. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +82 -3
  196. package/lib/engine-components/particlesystem/ParticleSystem.js +82 -3
  197. package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
  198. package/lib/engine-components/postprocessing/Effects/Antialiasing.d.ts +1 -0
  199. package/lib/engine-components/postprocessing/Effects/Antialiasing.js +1 -0
  200. package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
  201. package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -1
  202. package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -1
  203. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +1 -1
  204. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +1 -1
  205. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +1 -1
  206. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +1 -1
  207. package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +1 -1
  208. package/lib/engine-components/postprocessing/Effects/DepthOfField.js +1 -1
  209. package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
  210. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
  211. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
  212. package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +1 -1
  213. package/lib/engine-components/postprocessing/Effects/Pixelation.js +1 -1
  214. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.d.ts +1 -1
  215. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +1 -1
  216. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +1 -1
  217. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +1 -1
  218. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +1 -1
  219. package/lib/engine-components/postprocessing/Effects/Sharpening.js +1 -1
  220. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +1 -1
  221. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +1 -1
  222. package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +1 -1
  223. package/lib/engine-components/postprocessing/Effects/Tonemapping.js +1 -1
  224. package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +1 -1
  225. package/lib/engine-components/postprocessing/Effects/Vignette.js +1 -1
  226. package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +1 -1
  227. package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
  228. package/lib/engine-components/postprocessing/Volume.d.ts +1 -1
  229. package/lib/engine-components/postprocessing/Volume.js +1 -1
  230. package/lib/engine-components/splines/Spline.d.ts +409 -12
  231. package/lib/engine-components/splines/Spline.js +409 -12
  232. package/lib/engine-components/splines/Spline.js.map +1 -1
  233. package/lib/engine-components/splines/SplineUtils.d.ts +1 -0
  234. package/lib/engine-components/splines/SplineUtils.js +1 -0
  235. package/lib/engine-components/splines/SplineUtils.js.map +1 -1
  236. package/lib/engine-components/splines/SplineWalker.d.ts +3 -1
  237. package/lib/engine-components/splines/SplineWalker.js +3 -1
  238. package/lib/engine-components/splines/SplineWalker.js.map +1 -1
  239. package/lib/engine-components/timeline/PlayableDirector.d.ts +103 -14
  240. package/lib/engine-components/timeline/PlayableDirector.js +95 -25
  241. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  242. package/lib/engine-components/timeline/TimelineModels.d.ts +14 -0
  243. package/lib/engine-components/timeline/TimelineModels.js +4 -0
  244. package/lib/engine-components/timeline/TimelineModels.js.map +1 -1
  245. package/lib/engine-components/ui/Button.d.ts +29 -3
  246. package/lib/engine-components/ui/Button.js +29 -3
  247. package/lib/engine-components/ui/Button.js.map +1 -1
  248. package/lib/engine-components/ui/Canvas.d.ts +29 -4
  249. package/lib/engine-components/ui/Canvas.js +29 -4
  250. package/lib/engine-components/ui/Canvas.js.map +1 -1
  251. package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
  252. package/lib/engine-components/ui/CanvasGroup.js +1 -1
  253. package/lib/engine-components/ui/EventSystem.d.ts +1 -1
  254. package/lib/engine-components/ui/EventSystem.js +1 -1
  255. package/lib/engine-components/ui/Graphic.d.ts +1 -0
  256. package/lib/engine-components/ui/Graphic.js +1 -0
  257. package/lib/engine-components/ui/Graphic.js.map +1 -1
  258. package/lib/engine-components/ui/Image.d.ts +22 -3
  259. package/lib/engine-components/ui/Image.js +22 -3
  260. package/lib/engine-components/ui/Image.js.map +1 -1
  261. package/lib/engine-components/ui/InputField.d.ts +1 -1
  262. package/lib/engine-components/ui/InputField.js +1 -1
  263. package/lib/engine-components/ui/Layout.d.ts +3 -0
  264. package/lib/engine-components/ui/Layout.js +3 -0
  265. package/lib/engine-components/ui/Layout.js.map +1 -1
  266. package/lib/engine-components/ui/Outline.d.ts +1 -1
  267. package/lib/engine-components/ui/Outline.js +1 -1
  268. package/lib/engine-components/ui/PointerEvents.d.ts +1 -1
  269. package/lib/engine-components/ui/PointerEvents.js +1 -1
  270. package/lib/engine-components/ui/Raycaster.d.ts +55 -6
  271. package/lib/engine-components/ui/Raycaster.js +55 -6
  272. package/lib/engine-components/ui/Raycaster.js.map +1 -1
  273. package/lib/engine-components/ui/RectTransform.d.ts +1 -1
  274. package/lib/engine-components/ui/RectTransform.js +1 -1
  275. package/lib/engine-components/ui/SpatialHtml.d.ts +1 -1
  276. package/lib/engine-components/ui/SpatialHtml.js +1 -1
  277. package/lib/engine-components/ui/Text.d.ts +23 -1
  278. package/lib/engine-components/ui/Text.js +23 -1
  279. package/lib/engine-components/ui/Text.js.map +1 -1
  280. package/lib/engine-components/utils/LookAt.d.ts +1 -1
  281. package/lib/engine-components/utils/LookAt.js +1 -1
  282. package/lib/engine-components/utils/OpenURL.d.ts +1 -1
  283. package/lib/engine-components/utils/OpenURL.js +1 -1
  284. package/lib/engine-components/web/Clickthrough.d.ts +116 -7
  285. package/lib/engine-components/web/Clickthrough.js +116 -7
  286. package/lib/engine-components/web/Clickthrough.js.map +1 -1
  287. package/lib/engine-components/web/CursorFollow.d.ts +171 -7
  288. package/lib/engine-components/web/CursorFollow.js +171 -7
  289. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  290. package/lib/engine-components/web/HoverAnimation.d.ts +140 -11
  291. package/lib/engine-components/web/HoverAnimation.js +140 -11
  292. package/lib/engine-components/web/HoverAnimation.js.map +1 -1
  293. package/lib/engine-components/web/ScrollFollow.d.ts +4 -1
  294. package/lib/engine-components/web/ScrollFollow.js +4 -1
  295. package/lib/engine-components/web/ScrollFollow.js.map +1 -1
  296. package/lib/engine-components/web/ViewBox.d.ts +116 -16
  297. package/lib/engine-components/web/ViewBox.js +110 -16
  298. package/lib/engine-components/web/ViewBox.js.map +1 -1
  299. package/lib/engine-components/webxr/TeleportTarget.d.ts +21 -2
  300. package/lib/engine-components/webxr/TeleportTarget.js +21 -2
  301. package/lib/engine-components/webxr/TeleportTarget.js.map +1 -1
  302. package/lib/engine-components/webxr/WebXR.d.ts +10 -2
  303. package/lib/engine-components/webxr/WebXR.js +10 -2
  304. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  305. package/lib/engine-components/webxr/WebXRAvatar.d.ts +39 -2
  306. package/lib/engine-components/webxr/WebXRAvatar.js +35 -3
  307. package/lib/engine-components/webxr/WebXRAvatar.js.map +1 -1
  308. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +266 -30
  309. package/lib/engine-components/webxr/WebXRImageTracking.js +266 -30
  310. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  311. package/lib/engine-components/webxr/WebXRPlaneTracking.d.ts +1 -1
  312. package/lib/engine-components/webxr/WebXRPlaneTracking.js +1 -1
  313. package/lib/engine-components/webxr/XRFlag.d.ts +29 -2
  314. package/lib/engine-components/webxr/XRFlag.js +29 -2
  315. package/lib/engine-components/webxr/XRFlag.js.map +1 -1
  316. package/package.json +1 -1
  317. package/plugins/vite/custom-element-data.js +128 -19
  318. package/src/engine/engine_context.ts +16 -0
  319. package/src/engine/engine_gameobject.ts +73 -0
  320. package/src/engine/engine_input.ts +83 -7
  321. package/src/engine/engine_math.ts +81 -2
  322. package/src/engine/engine_networking.ts +186 -17
  323. package/src/engine/engine_networking_auto.ts +36 -9
  324. package/src/engine/engine_physics.ts +41 -1
  325. package/src/engine/engine_physics_rapier.ts +81 -0
  326. package/src/engine/engine_serialization_decorator.ts +28 -2
  327. package/src/engine/engine_time.ts +23 -3
  328. package/src/engine/engine_util_decorator.ts +31 -1
  329. package/src/engine/engine_utils.ts +21 -5
  330. package/src/engine/extensions/NEEDLE_materialx.ts +5 -4
  331. package/src/engine/extensions/index.ts +2 -2
  332. package/src/engine-components/AlignmentConstraint.ts +24 -4
  333. package/src/engine-components/Animation.ts +44 -2
  334. package/src/engine-components/Animator.ts +40 -7
  335. package/src/engine-components/AudioListener.ts +1 -1
  336. package/src/engine-components/AudioSource.ts +37 -15
  337. package/src/engine-components/AxesHelper.ts +23 -4
  338. package/src/engine-components/BasicIKConstraint.ts +28 -5
  339. package/src/engine-components/Camera.ts +33 -3
  340. package/src/engine-components/CharacterController.ts +74 -7
  341. package/src/engine-components/Collider.ts +78 -21
  342. package/src/engine-components/ContactShadows.ts +41 -11
  343. package/src/engine-components/DeleteBox.ts +43 -2
  344. package/src/engine-components/DeviceFlag.ts +22 -3
  345. package/src/engine-components/DragControls.ts +32 -2
  346. package/src/engine-components/DropListener.ts +41 -29
  347. package/src/engine-components/Duplicatable.ts +37 -6
  348. package/src/engine-components/EventList.ts +43 -15
  349. package/src/engine-components/EventTrigger.ts +1 -1
  350. package/src/engine-components/Fog.ts +23 -1
  351. package/src/engine-components/GridHelper.ts +18 -2
  352. package/src/engine-components/GroundProjection.ts +25 -3
  353. package/src/engine-components/Interactable.ts +17 -2
  354. package/src/engine-components/Joints.ts +51 -8
  355. package/src/engine-components/LODGroup.ts +45 -11
  356. package/src/engine-components/Light.ts +35 -13
  357. package/src/engine-components/LookAtConstraint.ts +26 -8
  358. package/src/engine-components/NeedleMenu.ts +29 -7
  359. package/src/engine-components/NestedGltf.ts +40 -4
  360. package/src/engine-components/OffsetConstraint.ts +27 -3
  361. package/src/engine-components/OrbitControls.ts +41 -3
  362. package/src/engine-components/PlayerColor.ts +1 -1
  363. package/src/engine-components/ReflectionProbe.ts +19 -5
  364. package/src/engine-components/Renderer.ts +35 -1
  365. package/src/engine-components/RigidBody.ts +64 -8
  366. package/src/engine-components/SceneSwitcher.ts +11 -0
  367. package/src/engine-components/ScreenCapture.ts +42 -9
  368. package/src/engine-components/SeeThrough.ts +76 -9
  369. package/src/engine-components/ShadowCatcher.ts +61 -6
  370. package/src/engine-components/Skybox.ts +48 -12
  371. package/src/engine-components/SmoothFollow.ts +68 -7
  372. package/src/engine-components/SpatialTrigger.ts +51 -4
  373. package/src/engine-components/SpectatorCamera.ts +23 -5
  374. package/src/engine-components/SyncedRoom.ts +8 -2
  375. package/src/engine-components/SyncedTransform.ts +59 -10
  376. package/src/engine-components/TransformGizmo.ts +31 -4
  377. package/src/engine-components/VideoPlayer.ts +48 -6
  378. package/src/engine-components/Voip.ts +33 -2
  379. package/src/engine-components/export/usdz/USDZExporter.ts +47 -13
  380. package/src/engine-components/particlesystem/ParticleSystem.ts +84 -5
  381. package/src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -0
  382. package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -1
  383. package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +1 -1
  384. package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +1 -1
  385. package/src/engine-components/postprocessing/Effects/DepthOfField.ts +1 -1
  386. package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
  387. package/src/engine-components/postprocessing/Effects/Pixelation.ts +1 -1
  388. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +1 -1
  389. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +1 -1
  390. package/src/engine-components/postprocessing/Effects/Sharpening.ts +1 -1
  391. package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +1 -1
  392. package/src/engine-components/postprocessing/Effects/Tonemapping.ts +1 -1
  393. package/src/engine-components/postprocessing/Effects/Vignette.ts +1 -1
  394. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
  395. package/src/engine-components/postprocessing/Volume.ts +1 -1
  396. package/src/engine-components/splines/Spline.ts +412 -14
  397. package/src/engine-components/splines/SplineUtils.ts +1 -0
  398. package/src/engine-components/splines/SplineWalker.ts +4 -2
  399. package/src/engine-components/timeline/PlayableDirector.ts +108 -27
  400. package/src/engine-components/timeline/SignalAsset.ts +1 -1
  401. package/src/engine-components/timeline/TimelineModels.ts +18 -2
  402. package/src/engine-components/ui/Button.ts +29 -3
  403. package/src/engine-components/ui/Canvas.ts +29 -4
  404. package/src/engine-components/ui/CanvasGroup.ts +2 -2
  405. package/src/engine-components/ui/EventSystem.ts +1 -1
  406. package/src/engine-components/ui/Graphic.ts +1 -0
  407. package/src/engine-components/ui/Image.ts +22 -3
  408. package/src/engine-components/ui/InputField.ts +2 -2
  409. package/src/engine-components/ui/Layout.ts +3 -0
  410. package/src/engine-components/ui/Outline.ts +1 -1
  411. package/src/engine-components/ui/PointerEvents.ts +1 -1
  412. package/src/engine-components/ui/Raycaster.ts +57 -8
  413. package/src/engine-components/ui/RectTransform.ts +2 -2
  414. package/src/engine-components/ui/SpatialHtml.ts +1 -1
  415. package/src/engine-components/ui/Text.ts +24 -2
  416. package/src/engine-components/utils/LookAt.ts +1 -1
  417. package/src/engine-components/utils/OpenURL.ts +1 -1
  418. package/src/engine-components/web/Clickthrough.ts +119 -10
  419. package/src/engine-components/web/CursorFollow.ts +174 -9
  420. package/src/engine-components/web/HoverAnimation.ts +142 -13
  421. package/src/engine-components/web/ScrollFollow.ts +4 -1
  422. package/src/engine-components/web/ViewBox.ts +118 -18
  423. package/src/engine-components/webxr/TeleportTarget.ts +23 -4
  424. package/src/engine-components/webxr/WebXR.ts +11 -3
  425. package/src/engine-components/webxr/WebXRAvatar.ts +41 -4
  426. package/src/engine-components/webxr/WebXRImageTracking.ts +282 -38
  427. package/src/engine-components/webxr/WebXRPlaneTracking.ts +1 -1
  428. package/src/engine-components/webxr/XRFlag.ts +30 -3
@@ -13,24 +13,85 @@ import { Behaviour } from "../Component.js";
13
13
  const debugParam = getParam("debugviewbox");
14
14
  const disabledGizmoColor = new RGBAColor(.5, .5, .5, .5);
15
15
 
16
+ /**
17
+ * Defines how the {@link ViewBox} component applies camera framing adjustments.
18
+ *
19
+ * - `"continuous"`: Camera framing is continuously updated while the ViewBox is active. Use for animated or dynamic ViewBoxes.
20
+ * - `"once"`: Camera framing is applied once when the ViewBox becomes active, then updates stop. Use for initial framing with subsequent user control.
21
+ */
16
22
  export type ViewBoxMode = "continuous" | "once";
17
23
 
18
24
  /**
19
- * This component can be used to automatically fit a certain box area into the camera view - no matter your screen size or aspect ratio.
20
- * This is useful for example to frame a character or object in the center of the screen and ensure it is always fully visible. You can also animate or scale the viewbox to create zoom or framing effects.
25
+ * [ViewBox](https://engine.needle.tools/docs/api/ViewBox) automatically fits a defined box area into the camera view regardless of screen size or aspect ratio.
26
+ * This component is useful for framing characters, objects, or scenes in the center of the view while ensuring they remain fully visible.
27
+ * You can animate or scale the viewbox to create dynamic zoom effects, cinematic transitions, or responsive framing.
21
28
  *
29
+ * [![](https://cloud.needle.tools/-/media/Thy6svVftsIC6Z_wIxUJMA.gif)](https://engine.needle.tools/samples/bike-scrollytelling-responsive-3d)
30
+ *
31
+ * The ViewBox component works by adjusting the camera's focus rect settings (offset and zoom) to ensure that the box defined by the
32
+ * GameObject's position, rotation, and scale fits perfectly within the visible viewport. It supports different modes for one-time
33
+ * fitting or continuous adjustment, making it versatile for both static compositions and animated sequences.
34
+ *
35
+ * **Key Features:**
36
+ * - Automatically adjusts camera framing to fit the box area
37
+ * - Works with any screen size and aspect ratio
38
+ * - Supports one-time fitting or continuous updates
39
+ * - Can be animated for dynamic zoom and framing effects
40
+ * - Multiple ViewBoxes can be active, with the most recently enabled taking priority
41
+ * - Handles camera positioning to ensure the box is visible (moves camera if inside the box)
42
+ *
43
+ * **Common Use Cases:**
44
+ * - Character framing in cutscenes or dialogue
45
+ * - Product showcases with guaranteed visibility
46
+ * - Scrollytelling experiences with animated camera movements
47
+ * - Responsive layouts that adapt to different screen sizes
48
+ * - UI-driven camera transitions
49
+ *
22
50
  * - [Example on needle.run](https://viewbox-demo-z23hmxbz2gkayo-z1nyzm6.needle.run/)
23
- * - [Scrollytelling Demo using animated Viewbox](https://scrollytelling-bike-z23hmxb2gnu5a.needle.run/)
51
+ * - [Scrollytelling Demo using animated Viewbox](https://scrollytelling-bike-z23hmxb2gnu5a.needle.run/)
24
52
  * - [Example on Stackblitz](https://stackblitz.com/edit/needle-engine-view-box-example)
25
- *
26
- * @example Add a Viewbox component to an object in your scene
53
+ *
54
+ * @example Basic setup - Add a ViewBox component to frame an object
55
+ * ```ts
56
+ * const viewBox = new Object3D();
57
+ * viewBox.position.set(0, 1, 0); // Position the viewbox center
58
+ * viewBox.scale.set(2, 2, 2); // Define the box size
59
+ * viewBox.addComponent(ViewBox, { debug: true });
60
+ * scene.add(viewBox);
61
+ * ```
62
+ *
63
+ * @example Animated ViewBox for zoom effects
64
+ * ```ts
65
+ * const viewBox = new Object3D();
66
+ * viewBox.addComponent(ViewBox, { mode: "continuous" });
67
+ * scene.add(viewBox);
68
+ *
69
+ * // Animate the viewbox scale over time
70
+ * function update() {
71
+ * const scale = 1 + Math.sin(Date.now() * 0.001) * 0.5;
72
+ * viewBox.scale.setScalar(scale);
73
+ * }
74
+ * ```
75
+ *
76
+ * @example One-time fitting with user control afterwards
27
77
  * ```ts
28
- const viewBox = new Object3D();
29
- viewBox.scale.set(0, 0, 0);
30
- viewBox.addComponent(ViewBox, { debug: true });
31
- scene.add(viewBox);
78
+ * const viewBox = new Object3D();
79
+ * viewBox.addComponent(ViewBox, {
80
+ * mode: "once", // Fit once, then allow free camera control
81
+ * referenceFieldOfView: 60
82
+ * });
83
+ * scene.add(viewBox);
32
84
  * ```
33
-
85
+ *
86
+ * @see {@link Camera} - The camera component that ViewBox controls
87
+ * @see {@link OrbitControls} - Camera controls that work alongside ViewBox
88
+ * @see {@link DragControls} - Alternative camera controls compatible with ViewBox
89
+ * @see {@link LookAtConstraint} - Another way to control camera targeting
90
+ * @see {@link SceneSwitcher} - Can be combined with ViewBox for scene transitions
91
+ * @see {@link Context.setCameraFocusRect} - The underlying focus rect API used by ViewBox
92
+ * @see {@link Context.focusRectSettings} - Manual control of focus rect settings
93
+ * @see {@link ViewBoxMode} - The mode type for controlling ViewBox behavior
94
+ *
34
95
  * @summary Automatically fits a box area into the camera view
35
96
  * @category Camera and Controls
36
97
  * @group Components
@@ -40,22 +101,50 @@ export type ViewBoxMode = "continuous" | "once";
40
101
  export class ViewBox extends Behaviour {
41
102
 
42
103
  /**
43
- * All active ViewBox instances. The last one in the array is the currently active one.
104
+ * Array of all active ViewBox instances in the scene.
105
+ * When multiple ViewBoxes are enabled, the last one in the array (most recently enabled) takes priority and controls the camera.
106
+ * Other ViewBoxes remain registered but inactive, displayed with a dimmed gizmo color when debug visualization is enabled.
44
107
  */
45
108
  static readonly instances: ViewBox[] = [];
46
109
 
47
110
  /**
48
- * The reference field of view is used to calculate the box size. This should usually be the same as your camera's fov.
49
- * @default -1 (meaning it will use the camera fov on the first frame)
111
+ * The reference field of view (in degrees) used to calculate how the box should fit within the camera view.
112
+ * This determines the baseline camera FOV for fitting calculations.
113
+ *
114
+ * **Behavior:**
115
+ * - If set to `-1` (default), the component will automatically use the camera's FOV on the first frame
116
+ * - Should typically match your camera's FOV for predictable framing
117
+ * - Can be set to a different value to create specific framing effects
118
+ *
119
+ * **Example:**
120
+ * If your camera has an FOV of 60° and you set `referenceFieldOfView` to 60, the ViewBox will fit objects
121
+ * as they would appear with that field of view. Setting it to a wider FOV (e.g., 90) makes objects appear
122
+ * smaller, while a narrower FOV (e.g., 30) makes them appear larger.
123
+ *
124
+ * @see {@link Camera} for the camera component and its FOV property
125
+ * @default -1 (automatically uses the camera's FOV on the first frame)
50
126
  */
51
127
  @serializable()
52
128
  referenceFieldOfView: number = -1;
53
129
 
54
130
  /**
55
- * The mode determines if the viewbox should be applied once or continuously while it is the active viewbox.
56
- * Options:
57
- * - "once": The viewbox will be applied once when it becomes the active viewbox. This is useful if you want to fit the view once and then allow the user to zoom or pan freely.
58
- * - "continuous": The viewbox will be applied continuously while it is the active viewbox. This is useful if you animate or scale the viewbox over time.
131
+ * Controls how the ViewBox applies camera adjustments.
132
+ *
133
+ * **Modes:**
134
+ * - `"once"`: Applies the framing adjustment once when the ViewBox becomes active, then stops updating.
135
+ * This is ideal when you want to frame the view initially but allow users to freely zoom, pan, or orbit afterwards.
136
+ * Perfect for interactive scenes where you want a good starting view but full user control.
137
+ *
138
+ * - `"continuous"`: Continuously updates the camera framing while this ViewBox is active.
139
+ * Use this when animating or scaling the ViewBox over time, or when you need the framing to constantly adjust.
140
+ * Great for cutscenes, scrollytelling, or any scenario with animated ViewBoxes.
141
+ *
142
+ * **Example Use Cases:**
143
+ * - Set to `"once"` for: Initial scene framing, product showcases where users explore freely after initial framing
144
+ * - Set to `"continuous"` for: Animated zoom effects, scrollytelling sequences, dynamic camera movements tied to ViewBox transforms
145
+ *
146
+ * @see {@link ViewBoxMode} for the type definition
147
+ * @default "continuous"
59
148
  */
60
149
  @serializable()
61
150
  get mode() { return this._mode; }
@@ -68,7 +157,18 @@ export class ViewBox extends Behaviour {
68
157
  private _mode: ViewBoxMode = "continuous";
69
158
 
70
159
  /**
71
- * Enable debug logs and rendering for this component instance
160
+ * Enables debug visualization and logging for this ViewBox instance.
161
+ *
162
+ * **When enabled, you will see:**
163
+ * - A yellow wireframe box showing the active ViewBox bounds in 3D space
164
+ * - Gray wireframe boxes for inactive ViewBox instances
165
+ * - A red dashed outline on screen showing the projected box in 2D (when using `?debugviewbox` URL parameter)
166
+ * - Console logs for mode changes, FOV settings, and camera adjustments
167
+ *
168
+ * **Tip:** You can also enable debug visualization globally for all ViewBoxes by adding `?debugviewbox` to your URL.
169
+ *
170
+ * @see {@link Gizmos} for the gizmo rendering system used for debug visualization
171
+ * @default false
72
172
  */
73
173
  @serializable()
74
174
  debug: boolean = false;
@@ -1,12 +1,31 @@
1
1
  import { Behaviour } from "../Component.js";
2
2
  import type { XRControllerMovement } from "./controllers/XRControllerMovement.js";
3
3
 
4
- /**
5
- * This component is just used as a marker on objects for WebXR teleportation
6
- * The {@link XRControllerMovement} component can be configured to check if the TeleportTarget component is present on an object to allow teleporting to that object.
7
- *
4
+ /**
5
+ * Marks a GameObject as a valid teleportation target for VR locomotion.
6
+ * Add this component to objects or surfaces where users should be able to teleport.
7
+ *
8
+ * **Usage:**
9
+ * - Add to floor surfaces, platforms, or designated teleport spots
10
+ * - Works with {@link XRControllerMovement} component's teleport system
11
+ * - Can be used to restrict teleportation to specific areas
12
+ *
13
+ * **Setup:**
14
+ * 1. Add this component to GameObjects that should be teleport destinations
15
+ * 2. Configure {@link XRControllerMovement} to use teleport targets (optional)
16
+ * 3. Test teleportation in VR mode
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // Make a platform teleportable
21
+ * const platform = myPlatform.addComponent(TeleportTarget);
22
+ * ```
23
+ *
24
+ * @summary Marker component for valid VR teleportation destinations
8
25
  * @category XR
9
26
  * @group Components
27
+ * @see {@link XRControllerMovement} for VR locomotion and teleport configuration
28
+ * @see {@link WebXR} for general WebXR setup
10
29
  */
11
30
  export class TeleportTarget extends Behaviour {
12
31
 
@@ -23,12 +23,13 @@ const debug = getParam("debugwebxr");
23
23
  const debugQuicklook = getParam("debugusdz");
24
24
 
25
25
  /**
26
- * Use the WebXR component to enable VR and AR on iOS and Android in your scene. VisionOS support is also provided via QuickLook USDZ export.
26
+ * Use the WebXR component to enable VR and AR on **iOS and Android** in your scene. VisionOS support is also provided via QuickLook USDZ export.
27
27
  *
28
- * The WebXR component is a simple to use wrapper around the {@link NeedleXRSession} API and adds some additional features like creating buttons for AR, VR, enabling default movement behaviour ({@link XRControllerMovement}) and controller rendering ({@link XRControllerModel}), as well as handling AR placement and Quicklook USDZ export.
28
+ * The WebXR component is a simple to use wrapper around the {@link NeedleXRSession} API and adds some additional features like creating buttons for AR, VR, enabling default movement behaviour ({@link XRControllerMovement}) and controller rendering ({@link XRControllerModel}), as well as handling AR placement and Quicklook USDZ export.
29
29
  *
30
- * - Example: https://samples.needle.tools/collaborative-sandbox
30
+ * ![](https://cloud.needle.tools/-/media/gcj_YoSns8FivafQRiCiOQ.gif)
31
31
  *
32
+ *
32
33
  * @example Enable VR and AR support using code
33
34
  * ```ts
34
35
  * import { onStart, WebXR } from "@needle-tools/engine";
@@ -54,6 +55,13 @@ const debugQuicklook = getParam("debugusdz");
54
55
  * @summary WebXR Component for VR and AR support
55
56
  * @category XR
56
57
  * @group Components
58
+ * @see {@link NeedleXRSession} for low-level XR API
59
+ * @see {@link XRControllerMovement} for VR locomotion
60
+ * @see {@link WebARSessionRoot} for AR session configuration
61
+ * @see {@link Avatar} for networked user avatars
62
+ * @link https://engine.needle.tools/docs/xr.html
63
+ * @link https://engine.needle.tools/samples/?overlay=samples&tag=xr
64
+ * @link https://engine.needle.tools/samples/collaborative-sandbox
57
65
  */
58
66
  export class WebXR extends Behaviour {
59
67
 
@@ -6,32 +6,61 @@ import { XRFlag } from "./XRFlag.js";
6
6
 
7
7
  export const debug = getParam("debugavatar");
8
8
 
9
+ /**
10
+ * Event arguments for avatar marker creation and destruction events
11
+ */
9
12
  export type AvatarMarkerEventArgs = {
13
+ /** The AvatarMarker component instance */
10
14
  avatarMarker: AvatarMarker;
15
+ /** The GameObject that contains the avatar marker */
11
16
  gameObject: Object3D;
12
17
  }
13
18
 
14
- /**
15
- * This is used to mark an object being controlled / owned by a player
16
- * This system might be refactored and moved to a more centralized place in a future version
19
+ /**
20
+ * Marks a GameObject as being controlled or owned by a player in networked XR sessions.
21
+ * This is used internally by the networking system to identify player-controlled objects.
22
+ *
23
+ * **Note:** This is an internal marker class. For most use cases, use the {@link Avatar} component instead.
24
+ *
25
+ * @summary Internal marker for player-controlled objects in networked sessions
26
+ * @category XR
27
+ * @category Networking
28
+ * @group Components
29
+ * @see {@link Avatar} for avatar setup and configuration
17
30
  */
18
- // We might be updating this system in the future to a centralized API (PlayerView)
31
+ // We might be updating this system in the future to a centralized API (PlayerView)
19
32
  // but since currently quite a few core components rely on it, we're keeping it for now
20
33
  export class AvatarMarker extends Behaviour {
21
34
 
35
+ /**
36
+ * Get an avatar marker by index from the global list of avatar markers.
37
+ * @param index The index in the instances array
38
+ * @returns The AvatarMarker at the specified index, or null if index is out of bounds
39
+ */
22
40
  public static getAvatar(index: number): AvatarMarker | null {
23
41
  if (index >= 0 && index < AvatarMarker.instances.length)
24
42
  return AvatarMarker.instances[index];
25
43
  return null;
26
44
  }
27
45
 
46
+ /** Global list of all active AvatarMarker instances */
28
47
  public static instances: AvatarMarker[] = [];
29
48
 
49
+ /**
50
+ * Subscribe to avatar marker creation events.
51
+ * @param cb Callback function called when a new avatar marker is created
52
+ * @returns The callback function (for removal)
53
+ */
30
54
  public static onAvatarMarkerCreated(cb: (args: AvatarMarkerEventArgs) => void): Function {
31
55
  AvatarMarker._onNewAvatarMarkerAdded.push(cb);
32
56
  return cb;
33
57
  }
34
58
 
59
+ /**
60
+ * Subscribe to avatar marker destruction events.
61
+ * @param cb Callback function called when an avatar marker is destroyed
62
+ * @returns The callback function (for removal)
63
+ */
35
64
  public static onAvatarMarkerDestroyed(cb: (args: AvatarMarkerEventArgs) => void): Function {
36
65
  AvatarMarker._onAvatarMarkerDestroyed.push(cb);
37
66
  return cb;
@@ -41,9 +70,12 @@ export class AvatarMarker extends Behaviour {
41
70
  private static _onAvatarMarkerDestroyed: Array<(args: AvatarMarkerEventArgs) => void> = [];
42
71
 
43
72
 
73
+ /** The network connection ID of the player who owns this avatar */
44
74
  public connectionId!: string;
75
+ /** Reference to the avatar GameObject with optional XR flags */
45
76
  public avatar?: Object3D & { flags?: XRFlag[] }
46
77
 
78
+ /** @internal */
47
79
  awake() {
48
80
  AvatarMarker.instances.push(this);
49
81
  if (debug)
@@ -53,6 +85,7 @@ export class AvatarMarker extends Behaviour {
53
85
  cb({ avatarMarker: this, gameObject: this.gameObject });
54
86
  }
55
87
 
88
+ /** @internal */
56
89
  onDestroy() {
57
90
  AvatarMarker.instances.splice(AvatarMarker.instances.indexOf(this), 1);
58
91
 
@@ -60,6 +93,10 @@ export class AvatarMarker extends Behaviour {
60
93
  cb({ avatarMarker: this, gameObject: this.gameObject });
61
94
  }
62
95
 
96
+ /**
97
+ * Check if this avatar marker represents the local player.
98
+ * @returns True if this avatar belongs to the local player, false otherwise
99
+ */
63
100
  isLocalAvatar() {
64
101
  return this.connectionId === this.context.connection.connectionId;
65
102
  }