@needle-tools/engine 4.13.0 → 4.13.1-next.6cb1b73

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 (452) 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/gltf-progressive-BTd714P0.min.js +9 -0
  6. package/dist/gltf-progressive-CrHduHPm.umd.cjs +9 -0
  7. package/dist/{gltf-progressive-eiJCrjLb.js → gltf-progressive-CsyU_5lc.js} +364 -287
  8. package/dist/{needle-engine.bundle-CxaKFQVS.min.js → needle-engine.bundle-DRSn34Va.min.js} +109 -109
  9. package/dist/{needle-engine.bundle-J4k4znv8.umd.cjs → needle-engine.bundle-qTjHpin6.umd.cjs} +110 -110
  10. package/dist/{needle-engine.bundle-Dl3TFYyv.js → needle-engine.bundle-wB3o8RB6.js} +2655 -2130
  11. package/dist/needle-engine.d.ts +4202 -423
  12. package/dist/needle-engine.js +3 -3
  13. package/dist/needle-engine.min.js +1 -1
  14. package/dist/needle-engine.umd.cjs +1 -1
  15. package/lib/engine/engine_context.d.ts +16 -0
  16. package/lib/engine/engine_context.js +28 -2
  17. package/lib/engine/engine_context.js.map +1 -1
  18. package/lib/engine/engine_gameobject.d.ts +72 -0
  19. package/lib/engine/engine_gameobject.js +38 -0
  20. package/lib/engine/engine_gameobject.js.map +1 -1
  21. package/lib/engine/engine_input.d.ts +80 -4
  22. package/lib/engine/engine_input.js +78 -2
  23. package/lib/engine/engine_input.js.map +1 -1
  24. package/lib/engine/engine_math.d.ts +81 -2
  25. package/lib/engine/engine_math.js +68 -2
  26. package/lib/engine/engine_math.js.map +1 -1
  27. package/lib/engine/engine_networking.d.ts +181 -14
  28. package/lib/engine/engine_networking.js +181 -14
  29. package/lib/engine/engine_networking.js.map +1 -1
  30. package/lib/engine/engine_networking_auto.d.ts +35 -8
  31. package/lib/engine/engine_networking_auto.js +35 -8
  32. package/lib/engine/engine_networking_auto.js.map +1 -1
  33. package/lib/engine/engine_physics.d.ts +37 -1
  34. package/lib/engine/engine_physics.js +37 -1
  35. package/lib/engine/engine_physics.js.map +1 -1
  36. package/lib/engine/engine_physics_rapier.d.ts +78 -0
  37. package/lib/engine/engine_physics_rapier.js +78 -0
  38. package/lib/engine/engine_physics_rapier.js.map +1 -1
  39. package/lib/engine/engine_serialization_decorator.d.ts +28 -2
  40. package/lib/engine/engine_serialization_decorator.js +28 -2
  41. package/lib/engine/engine_serialization_decorator.js.map +1 -1
  42. package/lib/engine/engine_time.d.ts +23 -3
  43. package/lib/engine/engine_time.js +23 -3
  44. package/lib/engine/engine_time.js.map +1 -1
  45. package/lib/engine/engine_util_decorator.d.ts +31 -1
  46. package/lib/engine/engine_util_decorator.js +31 -1
  47. package/lib/engine/engine_util_decorator.js.map +1 -1
  48. package/lib/engine/engine_utils.d.ts +22 -5
  49. package/lib/engine/engine_utils.js +22 -5
  50. package/lib/engine/engine_utils.js.map +1 -1
  51. package/lib/engine/engine_utils_screenshot.d.ts +171 -14
  52. package/lib/engine/engine_utils_screenshot.js +65 -0
  53. package/lib/engine/engine_utils_screenshot.js.map +1 -1
  54. package/lib/engine/engine_utils_screenshot.xr.d.ts +1 -1
  55. package/lib/engine/engine_utils_screenshot.xr.js +1 -1
  56. package/lib/engine/extensions/NEEDLE_materialx.d.ts +2 -2
  57. package/lib/engine/extensions/NEEDLE_materialx.js +2 -2
  58. package/lib/engine/extensions/NEEDLE_materialx.js.map +1 -1
  59. package/lib/engine/extensions/NEEDLE_techniques_webgl.js +3 -0
  60. package/lib/engine/extensions/NEEDLE_techniques_webgl.js.map +1 -1
  61. package/lib/engine/extensions/index.d.ts +1 -1
  62. package/lib/engine/extensions/index.js +1 -1
  63. package/lib/engine/extensions/index.js.map +1 -1
  64. package/lib/engine/xr/NeedleXRSession.d.ts +5 -0
  65. package/lib/engine/xr/NeedleXRSession.js +5 -0
  66. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  67. package/lib/engine-components/AlignmentConstraint.d.ts +23 -3
  68. package/lib/engine-components/AlignmentConstraint.js +23 -3
  69. package/lib/engine-components/AlignmentConstraint.js.map +1 -1
  70. package/lib/engine-components/Animation.d.ts +42 -0
  71. package/lib/engine-components/Animation.js +36 -0
  72. package/lib/engine-components/Animation.js.map +1 -1
  73. package/lib/engine-components/Animator.d.ts +37 -4
  74. package/lib/engine-components/Animator.js +37 -4
  75. package/lib/engine-components/Animator.js.map +1 -1
  76. package/lib/engine-components/AudioListener.d.ts +1 -1
  77. package/lib/engine-components/AudioListener.js +1 -1
  78. package/lib/engine-components/AudioSource.d.ts +32 -10
  79. package/lib/engine-components/AudioSource.js +32 -10
  80. package/lib/engine-components/AudioSource.js.map +1 -1
  81. package/lib/engine-components/AxesHelper.d.ts +22 -3
  82. package/lib/engine-components/AxesHelper.js +22 -3
  83. package/lib/engine-components/AxesHelper.js.map +1 -1
  84. package/lib/engine-components/BasicIKConstraint.d.ts +27 -4
  85. package/lib/engine-components/BasicIKConstraint.js +27 -4
  86. package/lib/engine-components/BasicIKConstraint.js.map +1 -1
  87. package/lib/engine-components/Camera.d.ts +32 -2
  88. package/lib/engine-components/Camera.js +32 -2
  89. package/lib/engine-components/Camera.js.map +1 -1
  90. package/lib/engine-components/CharacterController.d.ts +68 -4
  91. package/lib/engine-components/CharacterController.js +68 -4
  92. package/lib/engine-components/CharacterController.js.map +1 -1
  93. package/lib/engine-components/Collider.d.ts +69 -12
  94. package/lib/engine-components/Collider.js +69 -12
  95. package/lib/engine-components/Collider.js.map +1 -1
  96. package/lib/engine-components/ContactShadows.d.ts +28 -6
  97. package/lib/engine-components/ContactShadows.js +33 -8
  98. package/lib/engine-components/ContactShadows.js.map +1 -1
  99. package/lib/engine-components/DeleteBox.d.ts +43 -2
  100. package/lib/engine-components/DeleteBox.js +43 -2
  101. package/lib/engine-components/DeleteBox.js.map +1 -1
  102. package/lib/engine-components/DeviceFlag.d.ts +21 -2
  103. package/lib/engine-components/DeviceFlag.js +21 -2
  104. package/lib/engine-components/DeviceFlag.js.map +1 -1
  105. package/lib/engine-components/DragControls.d.ts +32 -2
  106. package/lib/engine-components/DragControls.js +32 -2
  107. package/lib/engine-components/DragControls.js.map +1 -1
  108. package/lib/engine-components/DropListener.d.ts +33 -21
  109. package/lib/engine-components/DropListener.js +33 -21
  110. package/lib/engine-components/DropListener.js.map +1 -1
  111. package/lib/engine-components/Duplicatable.d.ts +36 -5
  112. package/lib/engine-components/Duplicatable.js +36 -5
  113. package/lib/engine-components/Duplicatable.js.map +1 -1
  114. package/lib/engine-components/EventList.d.ts +38 -10
  115. package/lib/engine-components/EventList.js +40 -12
  116. package/lib/engine-components/EventList.js.map +1 -1
  117. package/lib/engine-components/EventTrigger.d.ts +1 -1
  118. package/lib/engine-components/EventTrigger.js +1 -1
  119. package/lib/engine-components/Fog.d.ts +23 -1
  120. package/lib/engine-components/Fog.js +23 -1
  121. package/lib/engine-components/Fog.js.map +1 -1
  122. package/lib/engine-components/GridHelper.d.ts +18 -2
  123. package/lib/engine-components/GridHelper.js +18 -2
  124. package/lib/engine-components/GridHelper.js.map +1 -1
  125. package/lib/engine-components/GroundProjection.d.ts +24 -2
  126. package/lib/engine-components/GroundProjection.js +24 -2
  127. package/lib/engine-components/GroundProjection.js.map +1 -1
  128. package/lib/engine-components/Interactable.d.ts +17 -2
  129. package/lib/engine-components/Interactable.js +17 -2
  130. package/lib/engine-components/Interactable.js.map +1 -1
  131. package/lib/engine-components/Joints.d.ts +50 -7
  132. package/lib/engine-components/Joints.js +50 -7
  133. package/lib/engine-components/Joints.js.map +1 -1
  134. package/lib/engine-components/LODGroup.d.ts +36 -14
  135. package/lib/engine-components/LODGroup.js +43 -11
  136. package/lib/engine-components/LODGroup.js.map +1 -1
  137. package/lib/engine-components/Light.d.ts +30 -5
  138. package/lib/engine-components/Light.js +30 -5
  139. package/lib/engine-components/Light.js.map +1 -1
  140. package/lib/engine-components/LookAtConstraint.d.ts +22 -7
  141. package/lib/engine-components/LookAtConstraint.js +22 -7
  142. package/lib/engine-components/LookAtConstraint.js.map +1 -1
  143. package/lib/engine-components/NeedleMenu.d.ts +27 -5
  144. package/lib/engine-components/NeedleMenu.js +27 -5
  145. package/lib/engine-components/NeedleMenu.js.map +1 -1
  146. package/lib/engine-components/NestedGltf.d.ts +39 -4
  147. package/lib/engine-components/NestedGltf.js +42 -4
  148. package/lib/engine-components/NestedGltf.js.map +1 -1
  149. package/lib/engine-components/OffsetConstraint.d.ts +27 -3
  150. package/lib/engine-components/OffsetConstraint.js +27 -3
  151. package/lib/engine-components/OffsetConstraint.js.map +1 -1
  152. package/lib/engine-components/OrbitControls.d.ts +41 -3
  153. package/lib/engine-components/OrbitControls.js +41 -3
  154. package/lib/engine-components/OrbitControls.js.map +1 -1
  155. package/lib/engine-components/PlayerColor.d.ts +1 -1
  156. package/lib/engine-components/PlayerColor.js +1 -1
  157. package/lib/engine-components/ReflectionProbe.d.ts +17 -2
  158. package/lib/engine-components/ReflectionProbe.js +17 -3
  159. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  160. package/lib/engine-components/Renderer.d.ts +35 -0
  161. package/lib/engine-components/Renderer.js +36 -2
  162. package/lib/engine-components/Renderer.js.map +1 -1
  163. package/lib/engine-components/RigidBody.d.ts +57 -5
  164. package/lib/engine-components/RigidBody.js +57 -5
  165. package/lib/engine-components/RigidBody.js.map +1 -1
  166. package/lib/engine-components/SceneSwitcher.d.ts +11 -0
  167. package/lib/engine-components/SceneSwitcher.js +11 -0
  168. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  169. package/lib/engine-components/ScreenCapture.d.ts +39 -6
  170. package/lib/engine-components/ScreenCapture.js +39 -6
  171. package/lib/engine-components/ScreenCapture.js.map +1 -1
  172. package/lib/engine-components/SeeThrough.d.ts +70 -5
  173. package/lib/engine-components/SeeThrough.js +70 -5
  174. package/lib/engine-components/SeeThrough.js.map +1 -1
  175. package/lib/engine-components/ShadowCatcher.d.ts +56 -4
  176. package/lib/engine-components/ShadowCatcher.js +56 -4
  177. package/lib/engine-components/ShadowCatcher.js.map +1 -1
  178. package/lib/engine-components/Skybox.d.ts +43 -7
  179. package/lib/engine-components/Skybox.js +43 -7
  180. package/lib/engine-components/Skybox.js.map +1 -1
  181. package/lib/engine-components/SmoothFollow.d.ts +66 -7
  182. package/lib/engine-components/SmoothFollow.js +66 -7
  183. package/lib/engine-components/SmoothFollow.js.map +1 -1
  184. package/lib/engine-components/SpatialTrigger.d.ts +48 -1
  185. package/lib/engine-components/SpatialTrigger.js +48 -1
  186. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  187. package/lib/engine-components/SpectatorCamera.d.ts +21 -3
  188. package/lib/engine-components/SpectatorCamera.js +21 -3
  189. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  190. package/lib/engine-components/SyncedRoom.d.ts +7 -1
  191. package/lib/engine-components/SyncedRoom.js +7 -1
  192. package/lib/engine-components/SyncedRoom.js.map +1 -1
  193. package/lib/engine-components/SyncedTransform.d.ts +55 -6
  194. package/lib/engine-components/SyncedTransform.js +55 -6
  195. package/lib/engine-components/SyncedTransform.js.map +1 -1
  196. package/lib/engine-components/TransformGizmo.d.ts +30 -3
  197. package/lib/engine-components/TransformGizmo.js +30 -3
  198. package/lib/engine-components/TransformGizmo.js.map +1 -1
  199. package/lib/engine-components/VideoPlayer.d.ts +33 -6
  200. package/lib/engine-components/VideoPlayer.js +51 -6
  201. package/lib/engine-components/VideoPlayer.js.map +1 -1
  202. package/lib/engine-components/Voip.d.ts +33 -2
  203. package/lib/engine-components/Voip.js +33 -2
  204. package/lib/engine-components/Voip.js.map +1 -1
  205. package/lib/engine-components/export/usdz/USDZExporter.d.ts +47 -13
  206. package/lib/engine-components/export/usdz/USDZExporter.js +47 -13
  207. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  208. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +82 -3
  209. package/lib/engine-components/particlesystem/ParticleSystem.js +82 -3
  210. package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
  211. package/lib/engine-components/postprocessing/Effects/Antialiasing.d.ts +1 -0
  212. package/lib/engine-components/postprocessing/Effects/Antialiasing.js +1 -0
  213. package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
  214. package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -1
  215. package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -1
  216. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +1 -1
  217. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +1 -1
  218. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +1 -1
  219. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +1 -1
  220. package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +1 -1
  221. package/lib/engine-components/postprocessing/Effects/DepthOfField.js +1 -1
  222. package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
  223. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
  224. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
  225. package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +1 -1
  226. package/lib/engine-components/postprocessing/Effects/Pixelation.js +1 -1
  227. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.d.ts +1 -1
  228. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +1 -1
  229. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +1 -1
  230. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +1 -1
  231. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +1 -1
  232. package/lib/engine-components/postprocessing/Effects/Sharpening.js +1 -1
  233. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +1 -1
  234. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +1 -1
  235. package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +1 -1
  236. package/lib/engine-components/postprocessing/Effects/Tonemapping.js +1 -1
  237. package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +1 -1
  238. package/lib/engine-components/postprocessing/Effects/Vignette.js +1 -1
  239. package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +1 -1
  240. package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
  241. package/lib/engine-components/postprocessing/Volume.d.ts +1 -1
  242. package/lib/engine-components/postprocessing/Volume.js +1 -1
  243. package/lib/engine-components/splines/Spline.d.ts +409 -12
  244. package/lib/engine-components/splines/Spline.js +409 -12
  245. package/lib/engine-components/splines/Spline.js.map +1 -1
  246. package/lib/engine-components/splines/SplineUtils.d.ts +1 -0
  247. package/lib/engine-components/splines/SplineUtils.js +1 -0
  248. package/lib/engine-components/splines/SplineUtils.js.map +1 -1
  249. package/lib/engine-components/splines/SplineWalker.d.ts +3 -1
  250. package/lib/engine-components/splines/SplineWalker.js +3 -1
  251. package/lib/engine-components/splines/SplineWalker.js.map +1 -1
  252. package/lib/engine-components/timeline/PlayableDirector.d.ts +103 -14
  253. package/lib/engine-components/timeline/PlayableDirector.js +95 -25
  254. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  255. package/lib/engine-components/timeline/TimelineModels.d.ts +14 -0
  256. package/lib/engine-components/timeline/TimelineModels.js +4 -0
  257. package/lib/engine-components/timeline/TimelineModels.js.map +1 -1
  258. package/lib/engine-components/ui/Button.d.ts +29 -3
  259. package/lib/engine-components/ui/Button.js +29 -3
  260. package/lib/engine-components/ui/Button.js.map +1 -1
  261. package/lib/engine-components/ui/Canvas.d.ts +29 -4
  262. package/lib/engine-components/ui/Canvas.js +29 -4
  263. package/lib/engine-components/ui/Canvas.js.map +1 -1
  264. package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
  265. package/lib/engine-components/ui/CanvasGroup.js +1 -1
  266. package/lib/engine-components/ui/EventSystem.d.ts +1 -1
  267. package/lib/engine-components/ui/EventSystem.js +1 -1
  268. package/lib/engine-components/ui/Graphic.d.ts +1 -0
  269. package/lib/engine-components/ui/Graphic.js +1 -0
  270. package/lib/engine-components/ui/Graphic.js.map +1 -1
  271. package/lib/engine-components/ui/Image.d.ts +22 -3
  272. package/lib/engine-components/ui/Image.js +22 -3
  273. package/lib/engine-components/ui/Image.js.map +1 -1
  274. package/lib/engine-components/ui/InputField.d.ts +1 -1
  275. package/lib/engine-components/ui/InputField.js +1 -1
  276. package/lib/engine-components/ui/Layout.d.ts +3 -0
  277. package/lib/engine-components/ui/Layout.js +3 -0
  278. package/lib/engine-components/ui/Layout.js.map +1 -1
  279. package/lib/engine-components/ui/Outline.d.ts +1 -1
  280. package/lib/engine-components/ui/Outline.js +1 -1
  281. package/lib/engine-components/ui/PointerEvents.d.ts +1 -1
  282. package/lib/engine-components/ui/PointerEvents.js +1 -1
  283. package/lib/engine-components/ui/Raycaster.d.ts +55 -6
  284. package/lib/engine-components/ui/Raycaster.js +55 -6
  285. package/lib/engine-components/ui/Raycaster.js.map +1 -1
  286. package/lib/engine-components/ui/RectTransform.d.ts +1 -1
  287. package/lib/engine-components/ui/RectTransform.js +1 -1
  288. package/lib/engine-components/ui/SpatialHtml.d.ts +1 -1
  289. package/lib/engine-components/ui/SpatialHtml.js +1 -1
  290. package/lib/engine-components/ui/Text.d.ts +23 -1
  291. package/lib/engine-components/ui/Text.js +23 -1
  292. package/lib/engine-components/ui/Text.js.map +1 -1
  293. package/lib/engine-components/utils/LookAt.d.ts +1 -1
  294. package/lib/engine-components/utils/LookAt.js +1 -1
  295. package/lib/engine-components/utils/OpenURL.d.ts +2 -1
  296. package/lib/engine-components/utils/OpenURL.js +2 -1
  297. package/lib/engine-components/utils/OpenURL.js.map +1 -1
  298. package/lib/engine-components/web/Clickthrough.d.ts +116 -7
  299. package/lib/engine-components/web/Clickthrough.js +116 -7
  300. package/lib/engine-components/web/Clickthrough.js.map +1 -1
  301. package/lib/engine-components/web/CursorFollow.d.ts +172 -7
  302. package/lib/engine-components/web/CursorFollow.js +172 -7
  303. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  304. package/lib/engine-components/web/HoverAnimation.d.ts +140 -11
  305. package/lib/engine-components/web/HoverAnimation.js +140 -11
  306. package/lib/engine-components/web/HoverAnimation.js.map +1 -1
  307. package/lib/engine-components/web/ScrollFollow.d.ts +5 -1
  308. package/lib/engine-components/web/ScrollFollow.js +5 -1
  309. package/lib/engine-components/web/ScrollFollow.js.map +1 -1
  310. package/lib/engine-components/web/ViewBox.d.ts +116 -16
  311. package/lib/engine-components/web/ViewBox.js +110 -16
  312. package/lib/engine-components/web/ViewBox.js.map +1 -1
  313. package/lib/engine-components/webxr/TeleportTarget.d.ts +21 -2
  314. package/lib/engine-components/webxr/TeleportTarget.js +21 -2
  315. package/lib/engine-components/webxr/TeleportTarget.js.map +1 -1
  316. package/lib/engine-components/webxr/WebARCameraBackground.d.ts +9 -0
  317. package/lib/engine-components/webxr/WebARCameraBackground.js +9 -0
  318. package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
  319. package/lib/engine-components/webxr/WebXR.d.ts +11 -2
  320. package/lib/engine-components/webxr/WebXR.js +11 -2
  321. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  322. package/lib/engine-components/webxr/WebXRAvatar.d.ts +39 -2
  323. package/lib/engine-components/webxr/WebXRAvatar.js +35 -3
  324. package/lib/engine-components/webxr/WebXRAvatar.js.map +1 -1
  325. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +266 -30
  326. package/lib/engine-components/webxr/WebXRImageTracking.js +266 -30
  327. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  328. package/lib/engine-components/webxr/WebXRPlaneTracking.d.ts +1 -1
  329. package/lib/engine-components/webxr/WebXRPlaneTracking.js +1 -1
  330. package/lib/engine-components/webxr/XRFlag.d.ts +29 -2
  331. package/lib/engine-components/webxr/XRFlag.js +29 -2
  332. package/lib/engine-components/webxr/XRFlag.js.map +1 -1
  333. package/package.json +3 -3
  334. package/plugins/vite/custom-element-data.js +128 -19
  335. package/src/engine/engine_context.ts +33 -3
  336. package/src/engine/engine_gameobject.ts +73 -0
  337. package/src/engine/engine_input.ts +83 -7
  338. package/src/engine/engine_math.ts +81 -2
  339. package/src/engine/engine_networking.ts +186 -17
  340. package/src/engine/engine_networking_auto.ts +36 -9
  341. package/src/engine/engine_physics.ts +41 -1
  342. package/src/engine/engine_physics_rapier.ts +81 -0
  343. package/src/engine/engine_serialization_decorator.ts +28 -2
  344. package/src/engine/engine_time.ts +23 -3
  345. package/src/engine/engine_util_decorator.ts +31 -1
  346. package/src/engine/engine_utils.ts +22 -5
  347. package/src/engine/engine_utils_screenshot.ts +241 -17
  348. package/src/engine/engine_utils_screenshot.xr.ts +1 -1
  349. package/src/engine/extensions/NEEDLE_materialx.ts +5 -4
  350. package/src/engine/extensions/NEEDLE_techniques_webgl.ts +3 -0
  351. package/src/engine/extensions/index.ts +2 -2
  352. package/src/engine/xr/NeedleXRSession.ts +5 -0
  353. package/src/engine-components/AlignmentConstraint.ts +24 -4
  354. package/src/engine-components/Animation.ts +44 -2
  355. package/src/engine-components/Animator.ts +40 -7
  356. package/src/engine-components/AudioListener.ts +1 -1
  357. package/src/engine-components/AudioSource.ts +37 -15
  358. package/src/engine-components/AxesHelper.ts +23 -4
  359. package/src/engine-components/BasicIKConstraint.ts +28 -5
  360. package/src/engine-components/Camera.ts +33 -3
  361. package/src/engine-components/CharacterController.ts +74 -7
  362. package/src/engine-components/Collider.ts +78 -21
  363. package/src/engine-components/ContactShadows.ts +41 -11
  364. package/src/engine-components/DeleteBox.ts +43 -2
  365. package/src/engine-components/DeviceFlag.ts +22 -3
  366. package/src/engine-components/DragControls.ts +32 -2
  367. package/src/engine-components/DropListener.ts +41 -29
  368. package/src/engine-components/Duplicatable.ts +37 -6
  369. package/src/engine-components/EventList.ts +43 -15
  370. package/src/engine-components/EventTrigger.ts +1 -1
  371. package/src/engine-components/Fog.ts +23 -1
  372. package/src/engine-components/GridHelper.ts +18 -2
  373. package/src/engine-components/GroundProjection.ts +25 -3
  374. package/src/engine-components/Interactable.ts +17 -2
  375. package/src/engine-components/Joints.ts +51 -8
  376. package/src/engine-components/LODGroup.ts +45 -11
  377. package/src/engine-components/Light.ts +35 -13
  378. package/src/engine-components/LookAtConstraint.ts +26 -8
  379. package/src/engine-components/NeedleMenu.ts +29 -7
  380. package/src/engine-components/NestedGltf.ts +40 -4
  381. package/src/engine-components/OffsetConstraint.ts +27 -3
  382. package/src/engine-components/OrbitControls.ts +41 -3
  383. package/src/engine-components/PlayerColor.ts +1 -1
  384. package/src/engine-components/ReflectionProbe.ts +19 -5
  385. package/src/engine-components/Renderer.ts +35 -1
  386. package/src/engine-components/RigidBody.ts +64 -8
  387. package/src/engine-components/SceneSwitcher.ts +11 -0
  388. package/src/engine-components/ScreenCapture.ts +42 -9
  389. package/src/engine-components/SeeThrough.ts +76 -9
  390. package/src/engine-components/ShadowCatcher.ts +61 -6
  391. package/src/engine-components/Skybox.ts +48 -12
  392. package/src/engine-components/SmoothFollow.ts +68 -7
  393. package/src/engine-components/SpatialTrigger.ts +51 -4
  394. package/src/engine-components/SpectatorCamera.ts +23 -5
  395. package/src/engine-components/SyncedRoom.ts +8 -2
  396. package/src/engine-components/SyncedTransform.ts +59 -10
  397. package/src/engine-components/TransformGizmo.ts +31 -4
  398. package/src/engine-components/VideoPlayer.ts +54 -6
  399. package/src/engine-components/Voip.ts +33 -2
  400. package/src/engine-components/export/usdz/USDZExporter.ts +47 -13
  401. package/src/engine-components/particlesystem/ParticleSystem.ts +84 -5
  402. package/src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -0
  403. package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -1
  404. package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +1 -1
  405. package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +1 -1
  406. package/src/engine-components/postprocessing/Effects/DepthOfField.ts +1 -1
  407. package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
  408. package/src/engine-components/postprocessing/Effects/Pixelation.ts +1 -1
  409. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +1 -1
  410. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +1 -1
  411. package/src/engine-components/postprocessing/Effects/Sharpening.ts +1 -1
  412. package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +1 -1
  413. package/src/engine-components/postprocessing/Effects/Tonemapping.ts +1 -1
  414. package/src/engine-components/postprocessing/Effects/Vignette.ts +1 -1
  415. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
  416. package/src/engine-components/postprocessing/Volume.ts +1 -1
  417. package/src/engine-components/splines/Spline.ts +412 -14
  418. package/src/engine-components/splines/SplineUtils.ts +1 -0
  419. package/src/engine-components/splines/SplineWalker.ts +4 -2
  420. package/src/engine-components/timeline/PlayableDirector.ts +108 -27
  421. package/src/engine-components/timeline/SignalAsset.ts +1 -1
  422. package/src/engine-components/timeline/TimelineModels.ts +18 -2
  423. package/src/engine-components/ui/Button.ts +29 -3
  424. package/src/engine-components/ui/Canvas.ts +29 -4
  425. package/src/engine-components/ui/CanvasGroup.ts +2 -2
  426. package/src/engine-components/ui/EventSystem.ts +1 -1
  427. package/src/engine-components/ui/Graphic.ts +1 -0
  428. package/src/engine-components/ui/Image.ts +22 -3
  429. package/src/engine-components/ui/InputField.ts +2 -2
  430. package/src/engine-components/ui/Layout.ts +3 -0
  431. package/src/engine-components/ui/Outline.ts +1 -1
  432. package/src/engine-components/ui/PointerEvents.ts +1 -1
  433. package/src/engine-components/ui/Raycaster.ts +57 -8
  434. package/src/engine-components/ui/RectTransform.ts +2 -2
  435. package/src/engine-components/ui/SpatialHtml.ts +1 -1
  436. package/src/engine-components/ui/Text.ts +24 -2
  437. package/src/engine-components/utils/LookAt.ts +1 -1
  438. package/src/engine-components/utils/OpenURL.ts +2 -1
  439. package/src/engine-components/web/Clickthrough.ts +119 -10
  440. package/src/engine-components/web/CursorFollow.ts +175 -9
  441. package/src/engine-components/web/HoverAnimation.ts +142 -13
  442. package/src/engine-components/web/ScrollFollow.ts +5 -1
  443. package/src/engine-components/web/ViewBox.ts +118 -18
  444. package/src/engine-components/webxr/TeleportTarget.ts +23 -4
  445. package/src/engine-components/webxr/WebARCameraBackground.ts +12 -3
  446. package/src/engine-components/webxr/WebXR.ts +12 -3
  447. package/src/engine-components/webxr/WebXRAvatar.ts +41 -4
  448. package/src/engine-components/webxr/WebXRImageTracking.ts +282 -38
  449. package/src/engine-components/webxr/WebXRPlaneTracking.ts +1 -1
  450. package/src/engine-components/webxr/XRFlag.ts +30 -3
  451. package/dist/gltf-progressive-BURrJW0U.umd.cjs +0 -8
  452. package/dist/gltf-progressive-DHLDFNvQ.min.js +0 -8
@@ -111,11 +111,27 @@ export function getUrlParams() {
111
111
  // bit strange that we have to pass T in here as well but otherwise the type parameter is stripped it seems
112
112
  type Param<T extends string> = string | boolean | number | T;
113
113
 
114
- /** Checks if a url parameter exists.
115
- * Returns true if it exists but has no value (e.g. ?help)
116
- * Returns false if it does not exist
117
- * Returns false if it's set to 0 e.g. ?debug=0
118
- * Returns the value if it exists e.g. ?message=hello
114
+ /**
115
+ * Checks if a URL parameter exists and returns its value.
116
+ * Useful for debugging, feature flags, and configuration.
117
+ *
118
+ * @param paramName The URL parameter name to check
119
+ * @returns
120
+ * - `true` if the parameter exists without a value (e.g. `?debug`)
121
+ * - `false` if the parameter doesn't exist or is set to `0`
122
+ * - The numeric value if it's a number (e.g. `?level=5` returns `5`)
123
+ * - The string value otherwise (e.g. `?name=test` returns `"test"`)
124
+ *
125
+ * @example Check debug mode
126
+ * ```ts
127
+ * if (getParam("debug")) {
128
+ * console.log("Debug mode enabled");
129
+ * }
130
+ * ```
131
+ * @example Get a numeric value
132
+ * ```ts
133
+ * const level = getParam("level"); // Returns number if ?level=5
134
+ * ```
119
135
  */
120
136
  export function getParam<T extends string>(paramName: T): Param<T> {
121
137
  if (showHelp && !requestedParams.includes(paramName))
@@ -573,6 +589,7 @@ declare global {
573
589
 
574
590
  /**
575
591
  * Utility functions to detect certain device types (mobile, desktop), browsers, or capabilities.
592
+ * @category Utilities
576
593
  */
577
594
  export namespace DeviceUtilities {
578
595
 
@@ -32,6 +32,7 @@ declare type ScreenshotImageMimeType = "image/webp" | "image/png" | "image/jpeg"
32
32
  * const dataUrl = screenshot();
33
33
  * saveImage(dataUrl, "screenshot.png");
34
34
  * ```
35
+ *
35
36
  */
36
37
  export function screenshot(context?: Context, width?: number, height?: number, mimeType: ScreenshotImageMimeType = "image/webp", camera?: Camera | null): string | null {
37
38
  return screenshot2({ context, width, height, mimeType, camera });
@@ -106,12 +107,30 @@ export declare type ScreenshotOptionsBlob = ScreenshotOptions & {
106
107
  }
107
108
 
108
109
  export declare type ScreenshotOptionsShare = ScreenshotOptions & {
110
+ /**
111
+ * Set `{ type: "share" }` to share the screenshot using the Web Share API. The promise will resolve with the blob of the screenshot and whether it was shared successfully or not. Note that the Web Share API is only available in secure contexts (HTTPS) and on some platforms.
112
+ */
109
113
  type: "share",
114
+ /**
115
+ * The filename to use when sharing the screenshot. If not provided, a default filename will be used.
116
+ */
110
117
  filename?: string,
118
+ /**
119
+ * The mime type of the shared file. If not provided, the mime type will be inferred from the screenshot options or default to "image/png".
120
+ */
111
121
  file_type?: ScreenshotImageMimeType,
112
122
 
123
+ /**
124
+ * The title to use when sharing the screenshot. This is optional and may not be supported by all platforms.
125
+ */
113
126
  title?: string,
127
+ /**
128
+ * The text to use when sharing the screenshot. This is optional and may not be supported by all platforms.
129
+ */
114
130
  text?: string,
131
+ /**
132
+ * The URL to use when sharing the screenshot. This is optional and may not be supported by all platforms.
133
+ */
115
134
  url?: string,
116
135
  }
117
136
 
@@ -120,36 +139,241 @@ declare type ScreenshotOptionsShareReturnType = {
120
139
  shared: boolean,
121
140
  }
122
141
 
123
- /**
124
- * Take a screenshot from the current scene and return a {@link Texture}. This can applied to a surface in 3D space.
125
- * @param opts Provide `{ type: "texture" }` to get a texture instead of a data url.
142
+ /**
143
+ * Take a screenshot from the current scene and return a {@link Texture}. This can be applied to a surface in 3D space.
144
+ * @param opts Provide `{ type: "texture" }` to get a texture instead of a data url.
126
145
  * @returns The texture of the screenshot. Returns null if the screenshot could not be taken.
146
+ * @category Utilities
147
+ * @example
148
+ * ```ts
149
+ * // Create a texture from the current view
150
+ * const screenshotTexture = screenshot2({ type: "texture", width: 512, height: 512 });
151
+ * if (screenshotTexture) {
152
+ * myMaterial.map = screenshotTexture;
153
+ * myMaterial.needsUpdate = true;
154
+ * }
155
+ *
156
+ * // Update an existing texture
157
+ * const existingTexture = new Texture();
158
+ * screenshot2({ type: "texture", target: existingTexture, transparent: true });
159
+ * ```
127
160
  */
128
161
  export function screenshot2(opts: ScreenshotOptionsTexture): Texture | null;
162
+
129
163
  /**
130
- * Take a screenshot from the current scene.
131
- * @param opts
132
- * @returns The data url of the screenshot. Returns null if the screenshot could not be taken.
133
- * ```ts
134
- * const res = screenshot2({
135
- * width: 1024,
164
+ * Take a screenshot from the current scene and return a data URL string.
165
+ *
166
+ * @param opts Screenshot options. All properties are optional.
167
+ * @returns The data URL of the screenshot (e.g., "data:image/png;base64,..."). Returns null if the screenshot could not be taken.
168
+ * @category Utilities
169
+ *
170
+ * @example Basic screenshot
171
+ * ```ts
172
+ * // Take a simple screenshot with default settings
173
+ * const dataUrl = screenshot2({});
174
+ * console.log(dataUrl); // "data:image/webp;base64,..."
175
+ * ```
176
+ *
177
+ * @example High-resolution screenshot with transparent background
178
+ * ```ts
179
+ * const dataUrl = screenshot2({
180
+ * width: 2048,
181
+ * height: 2048,
182
+ * mimeType: "image/png",
183
+ * transparent: true,
184
+ * trim: true, // Remove transparent edges
185
+ * });
186
+ * ```
187
+ *
188
+ * @example Screenshot with custom background color
189
+ * ```ts
190
+ * import { Color } from "three";
191
+ *
192
+ * const dataUrl = screenshot2({
193
+ * width: 1024,
194
+ * height: 1024,
195
+ * background: new Color(0x00ff00), // Green background
196
+ * });
197
+ * ```
198
+ *
199
+ * @example Download screenshot automatically
200
+ * ```ts
201
+ * screenshot2({
202
+ * width: 1920,
203
+ * height: 1080,
204
+ * mimeType: "image/jpeg",
205
+ * download_filename: "my-scene.jpg",
206
+ * });
207
+ * ```
208
+ *
209
+ * @example Manual download using saveImage
210
+ * ```ts
211
+ * const dataUrl = screenshot2({
212
+ * width: 1024,
213
+ * height: 1024,
214
+ * mimeType: "image/webp",
215
+ * transparent: true,
216
+ * });
217
+ * if (dataUrl) {
218
+ * saveImage(dataUrl, "screenshot.webp");
219
+ * }
220
+ * ```
221
+ *
222
+ * @example Screenshot from specific camera
223
+ * ```ts
224
+ * const myCamera = this.gameObject.getComponent(Camera);
225
+ * const dataUrl = screenshot2({
226
+ * camera: myCamera,
227
+ * width: 1024,
136
228
  * height: 1024,
137
- * mimeType: "image/webp",
138
- * transparent: true,
139
- * })
140
- * // use saveImage to download the image
141
- * saveImage(res, "screenshot.webp");
229
+ * });
142
230
  * ```
143
231
  */
144
232
  export function screenshot2(opts: ScreenshotOptionsDataUrl): string | null;
145
233
 
146
234
  /**
147
- * Take a screenshot asynchronously from the current scene.
148
- * @returns A promise that resolves with the blob of the screenshot. Returns null if the screenshot could not be taken.
149
- * @param {ScreenshotOptionsBlob} opts Set `{ type: "blob" }` to get a blob instead of a data url.
235
+ * Take a screenshot asynchronously and return a Blob. This is useful when you need to process or upload the image data.
236
+ *
237
+ * @param opts Set `{ type: "blob" }` to get a blob instead of a data url. All other {@link ScreenshotOptions} are also available.
238
+ * @returns A Promise that resolves with the Blob of the screenshot. Returns null if the screenshot could not be taken.
239
+ * @category Utilities
240
+ *
241
+ * @example Upload screenshot to server
242
+ * ```ts
243
+ * const blob = await screenshot2({ type: "blob", mimeType: "image/png" });
244
+ * if (blob) {
245
+ * const formData = new FormData();
246
+ * formData.append("screenshot", blob, "screenshot.png");
247
+ * await fetch("/api/upload", { method: "POST", body: formData });
248
+ * }
249
+ * ```
250
+ *
251
+ * @example Save blob to file (browser download)
252
+ * ```ts
253
+ * const blob = await screenshot2({
254
+ * type: "blob",
255
+ * width: 1920,
256
+ * height: 1080,
257
+ * transparent: true
258
+ * });
259
+ * if (blob) {
260
+ * const url = URL.createObjectURL(blob);
261
+ * saveImage(url, "screenshot.png");
262
+ * URL.revokeObjectURL(url); // Clean up
263
+ * }
264
+ * ```
150
265
  */
151
266
  export function screenshot2(opts: ScreenshotOptionsBlob): Promise<Blob | null>;
267
+
268
+ /**
269
+ * Take a screenshot and share it using the Web Share API (mobile-friendly).
270
+ *
271
+ * **Note**: The Web Share API is only available in secure contexts (HTTPS) and may not be supported on all platforms/browsers.
272
+ *
273
+ * @param opts Set `{ type: "share" }` to share the screenshot. Additional options like `filename`, `title`, `text`, and `url` can be provided.
274
+ * @returns A Promise that resolves with an object containing the blob and whether it was successfully shared.
275
+ * @category Utilities
276
+ *
277
+ * @example Share screenshot on mobile
278
+ * ```ts
279
+ * const result = await screenshot2({
280
+ * type: "share",
281
+ * filename: "my-creation.png",
282
+ * title: "Check out my 3D scene!",
283
+ * text: "I created this with Needle Engine",
284
+ * url: "https://engine.needle.tools",
285
+ * mimeType: "image/png",
286
+ * });
287
+ *
288
+ * if (result.shared) {
289
+ * console.log("Screenshot shared successfully!");
290
+ * } else {
291
+ * console.log("User cancelled or sharing not supported");
292
+ * }
293
+ * ```
294
+ *
295
+ * @example Share with fallback
296
+ * ```ts
297
+ * const result = await screenshot2({
298
+ * type: "share",
299
+ * filename: "screenshot.webp",
300
+ * file_type: "image/webp",
301
+ * });
302
+ *
303
+ * if (!result.shared && result.blob) {
304
+ * // Fallback: download the image instead
305
+ * const url = URL.createObjectURL(result.blob);
306
+ * saveImage(url, "screenshot.webp");
307
+ * URL.revokeObjectURL(url);
308
+ * }
309
+ * ```
310
+ */
152
311
  export function screenshot2(opts: ScreenshotOptionsShare): Promise<ScreenshotOptionsShareReturnType>;
312
+
313
+ /**
314
+ * Take a screenshot from the current scene with advanced options.
315
+ *
316
+ * This is the main screenshot function in Needle Engine with support for multiple output formats:
317
+ * - **Data URL** (default): Returns a base64-encoded string suitable for img src attributes
318
+ * - **Texture**: Returns a Three.js Texture that can be applied to materials
319
+ * - **Blob**: Returns a Blob for uploading or processing (async)
320
+ * - **Share**: Uses the Web Share API to share the screenshot (async, mobile-friendly)
321
+ *
322
+ * @param opts Screenshot options. Use the `type` property to specify output format. See {@link ScreenshotOptions} for all available options.
323
+ * @returns Depending on the `type` option:
324
+ * - Data URL (string) when `type` is undefined or not specified
325
+ * - Texture when `type: "texture"`
326
+ * - Promise<Blob | null> when `type: "blob"`
327
+ * - Promise<{blob, shared}> when `type: "share"`
328
+ *
329
+ * Returns null (or Promise resolving to null) if the screenshot could not be taken.
330
+ *
331
+ * @category Utilities
332
+ *
333
+ * @example WebXR / AR Screenshots
334
+ * ```ts
335
+ * // Screenshots work automatically in WebXR sessions
336
+ * // The camera feed will be composited with your 3D content
337
+ * const dataUrl = screenshot2({
338
+ * width: 1920,
339
+ * height: 1080
340
+ * });
341
+ * ```
342
+ *
343
+ * **Note for AR Screenshots**: To include the device camera feed in AR screenshots, you need to request camera access.
344
+ * This is done automatically when you use {@link WebARCameraBackground} component in your scene.
345
+ * If you're not using WebARCameraBackground, you can request camera access manually:
346
+ * ```ts
347
+ * export class MyComponent extends Behaviour {
348
+ * onBeforeXR(mode: XRSessionMode, args: XRSessionInit): void {
349
+ * if (mode === "immersive-ar") {
350
+ * args.optionalFeatures = args.optionalFeatures || [];
351
+ * args.optionalFeatures.push('camera-access');
352
+ * }
353
+ * }
354
+ * }
355
+ * ```
356
+ * Without camera access, AR screenshots will only show your 3D content without the real-world background.
357
+ *
358
+ * @example Combining multiple options
359
+ * ```ts
360
+ * // High-res transparent screenshot with custom camera
361
+ * const myCamera = this.gameObject.getComponent(Camera);
362
+ * const texture = screenshot2({
363
+ * type: "texture",
364
+ * camera: myCamera,
365
+ * width: 2048,
366
+ * height: 2048,
367
+ * transparent: true,
368
+ * trim: true,
369
+ * render_events: true, // Ensure reflection probes are updated
370
+ * });
371
+ * ```
372
+ *
373
+ * @see {@link screenshot} for a simpler alternative with fewer options
374
+ * @see {@link saveImage} for downloading data URLs
375
+ * @see {@link ScreenshotOptions} for all available options
376
+ */
153
377
  export function screenshot2(opts: ScreenshotOptionsDataUrl | ScreenshotOptionsTexture | ScreenshotOptionsBlob | ScreenshotOptionsShare)
154
378
  : Texture | string | null | Promise<Blob | null> | Promise<ScreenshotOptionsShareReturnType> {
155
379
 
@@ -5,7 +5,7 @@ import { isDevEnvironment, showBalloonError } from "./debug/index.js";
5
5
  // Adapted from WebARCameraBackground
6
6
 
7
7
  /**
8
- * Assigns the camera feed to a texture - this must be called during the render loop
8
+ * Assigns the camera feed to a texture - this must be called during the render loop.
9
9
  */
10
10
  export function updateTextureFromXRFrame(renderer: WebGLRenderer, target: Texture): boolean {
11
11
 
@@ -1,8 +1,9 @@
1
1
  import { Loader, LoadingManager, Material, Object3D, TextureLoader } from "three";
2
- import { GLTFLoader, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
3
- import { ObjectUtils } from "../engine_create_objects";
4
- import { MODULES } from "../engine_modules";
5
- import { IContext } from "../engine_types";
2
+ import { GLTFLoader, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
3
+
4
+ import { ObjectUtils } from "../engine_create_objects.js";
5
+ import { MODULES } from "../engine_modules.js";
6
+ import { IContext } from "../engine_types.js";
6
7
 
7
8
 
8
9
  // #region Utils
@@ -621,6 +621,9 @@ function createUniformProperties(material: CustomShader) {
621
621
  case "_Color":
622
622
  defineProperty("color", key);
623
623
  break;
624
+ case "_map":
625
+ defineProperty("map", key);
626
+ break;
624
627
  // case "_Metallic":
625
628
  // defineProperty("metalness", key);
626
629
  // break;
@@ -2,6 +2,6 @@ export { compareAssociation } from "./extension_utils.js"
2
2
  export * from "./extensions.js"
3
3
  export * from "./NEEDLE_animator_controller_model.js"
4
4
  export { SceneLightSettings } from "./NEEDLE_lighting_settings.js"
5
+ export { MaterialX } from "./NEEDLE_materialx.js"
5
6
  export * from "./NEEDLE_progressive.js"
6
- export { CustomShader } from "./NEEDLE_techniques_webgl.js"
7
- export { MaterialX } from "./NEEDLE_materialx.js"
7
+ export { CustomShader } from "./NEEDLE_techniques_webgl.js"
@@ -279,7 +279,12 @@ const $initialFov = Symbol("initial-fov");
279
279
  * The XRRig can be accessed via the `rig` property
280
280
  * Set a custom XRRig via `NeedleXRSession.addRig(...)` or `NeedleXRSession.removeRig(...)`
281
281
  * By default the active XRRig with the highest priority in the scene is used
282
+ *
283
+ * ### Screenshots in XR
284
+ * Screenshots work automatically during XR sessions, including AR camera feed compositing. See {@link screenshot2} for more information.
285
+ *
282
286
  * @category XR
287
+ * @see {@link screenshot2} for taking screenshots in XR sessions
283
288
  */
284
289
  export class NeedleXRSession implements INeedleXRSession {
285
290
 
@@ -5,12 +5,32 @@ import * as utils from "./../engine/engine_three_utils.js";
5
5
  import { Behaviour, GameObject } from "./Component.js";
6
6
 
7
7
  /**
8
- * Aligns this GameObject between two other GameObjects, scaling it to fit the distance.
9
- * You can use this to create dynamic beams or connectors between objects.
8
+ * The [AlignmentConstraint](https://engine.needle.tools/docs/api/AlignmentConstraint) positions and scales this GameObject to span between two target objects.
9
+ * The object is rotated to face `to` and scaled along Z to match the distance.
10
10
  *
11
- * @summary Aligns and scales the object between two target GameObjects
11
+ * **Use cases:**
12
+ * - Dynamic beams or laser effects between objects
13
+ * - Stretchy connectors or ropes
14
+ * - Visual links between UI elements
15
+ * - Debug lines between transforms
16
+ *
17
+ * **How it works:**
18
+ * - Position: Centered between `from` and `to` (or at `from` if not centered)
19
+ * - Rotation: Looks at `to` from `from`
20
+ * - Scale: Z-axis scales to match distance, X/Y use `width`
21
+ *
22
+ * @example Create a beam between two objects
23
+ * ```ts
24
+ * const beam = beamMesh.addComponent(AlignmentConstraint);
25
+ * // Set targets via serialized properties in editor
26
+ * // or via code if properties are exposed
27
+ * ```
28
+ *
29
+ * @summary Aligns and scales object between two targets
12
30
  * @category Constraints
13
- * @group Components
31
+ * @group Components
32
+ * @see {@link LookAtConstraint} for rotation-only constraints
33
+ * @see {@link SmoothFollow} for following with smoothing
14
34
  **/
15
35
  export class AlignmentConstraint extends Behaviour {
16
36
 
@@ -10,6 +10,12 @@ import { Behaviour } from "./Component.js";
10
10
 
11
11
  const debug = getParam("debuganimation");
12
12
 
13
+ /**
14
+ * Options for controlling animation playback via {@link Animation.play}.
15
+ * All options are optional - defaults are sensible for most use cases.
16
+ *
17
+ * @see {@link Animation} for the component that uses these options
18
+ */
13
19
  export declare type PlayOptions = {
14
20
  /**
15
21
  * The fade duration in seconds for the action to fade in and other actions to fade out (if exclusive is enabled)
@@ -59,11 +65,47 @@ declare type AnimationIdentifier = AnimationClip | number | string | undefined;
59
65
  class Vec2 { x!: number; y!: number }
60
66
 
61
67
  /**
62
- * Animation component to play animations on a GameObject.
68
+ * Animation component to play animations on a GameObject.
69
+ * For simpler animation needs compared to {@link Animator}, this component directly
70
+ * plays AnimationClips without state machine logic.
71
+ *
72
+ * **Key features:**
73
+ * - Play animations by index, name, or clip reference
74
+ * - Cross-fade between animations with `fadeDuration`
75
+ * - Loop or play once with optional clamping
76
+ * - Random start time and speed variation
77
+ * - Promise-based completion handling
78
+ *
63
79
  *
64
- * @summary Plays animations from AnimationClips
80
+ * ![](https://cloud.needle.tools/-/media/zXQhLgtxr5ZaxLDTDb3MXA.gif)
81
+ *
82
+ * @example Play animation by name
83
+ * ```ts
84
+ * const anim = this.gameObject.getComponent(Animation);
85
+ * await anim?.play("Walk", { loop: true, fadeDuration: 0.3 });
86
+ * ```
87
+ *
88
+ * @example Play with options
89
+ * ```ts
90
+ * anim?.play(0, {
91
+ * loop: false,
92
+ * clampWhenFinished: true,
93
+ * speed: 2
94
+ * });
95
+ * ```
96
+ *
97
+ * @summary Plays animations from AnimationClips
65
98
  * @category Animation and Sequencing
66
99
  * @group Components
100
+ * @see {@link Animator} for state machine-based animation
101
+ * @see {@link PlayOptions} for all playback options
102
+ * @link https://engine.needle.tools/samples/?overlay=samples&tag=animation
103
+ * @link https://engine.needle.tools/samples/imunogard/
104
+ *
105
+ * @link https://engine.needle.tools/docs/blender/animation.html
106
+ *
107
+ * ![](https://cloud.needle.tools/-/media/vAYv-kU-eMpICqQZHJktCA.gif)
108
+ *
67
109
  */
68
110
  export class Animation extends Behaviour implements IAnimationComponent {
69
111
 
@@ -12,7 +12,7 @@ import { Behaviour } from "./Component.js";
12
12
  const debug = getParam("debuganimator");
13
13
 
14
14
  /**
15
- * Represents an event emitted by an animation mixer
15
+ * Represents an event emitted by an animation mixer
16
16
  * @category Animation and Sequencing
17
17
  * @group Components
18
18
  */
@@ -28,7 +28,7 @@ export declare class MixerEvent {
28
28
  }
29
29
 
30
30
  /**
31
- * Configuration options for playing animations
31
+ * Configuration options for playing animations
32
32
  * @category Animation and Sequencing
33
33
  */
34
34
  export declare class PlayOptions {
@@ -38,15 +38,48 @@ export declare class PlayOptions {
38
38
  clampWhenFinished?: boolean;
39
39
  }
40
40
 
41
- /**
42
- * The Animator component plays and manages animations on a GameObject.
43
- * It works with an {@link AnimatorController} to handle state transitions and animation blending.
44
- * A new AnimatorController can be created from code via `AnimatorController.createFromClips`.
41
+ /**
42
+ * Animator plays and manages state-machine based animations on a GameObject.
43
+ * Uses an {@link AnimatorController} for state transitions, blending, and parameters.
44
+ *
45
+ * **State machine animations:**
46
+ * Define animation states and transitions in Unity's Animator window or in [Blender's Animator Controller editor](https://engine.needle.tools/docs/blender/animation.html)
47
+ * Control transitions via parameters (bool, int, float, trigger).
45
48
  *
49
+ * ![](https://cloud.needle.tools/-/media/zXQhLgtxr5ZaxLDTDb3MXA.gif)
50
+ *
51
+ * **Creating at runtime:**
52
+ * Use `AnimatorController.createFromClips()` to create controllers from code.
53
+ *
54
+ * **Parameters:**
55
+ * - `setTrigger(name)` - Trigger a one-shot transition
56
+ * - `setBool(name, value)` - Set boolean parameter
57
+ * - `setFloat(name, value)` - Set float parameter
58
+ * - `setInteger(name, value)` - Set integer parameter
59
+ *
60
+ * @example Trigger animation state
61
+ * ```ts
62
+ * const animator = myCharacter.getComponent(Animator);
63
+ * animator.setTrigger("Jump");
64
+ * animator.setFloat("Speed", 5);
65
+ * animator.setBool("IsRunning", true);
66
+ * ```
67
+ *
68
+ * @example Listen to animation events
69
+ * ```ts
70
+ * animator.onLoop(evt => console.log("Animation looped"));
71
+ * animator.onFinished(evt => console.log("Animation finished"));
72
+ * ```
73
+ *
46
74
  * @summary Plays and manages animations on a GameObject based on an AnimatorController
47
75
  * @category Animation and Sequencing
48
76
  * @group Components
49
- */
77
+ * @see {@link AnimatorController} for state machine configuration
78
+ * @see {@link Animation} for simple clip playback
79
+ * @see {@link PlayableDirector} for timeline-based animation
80
+ *
81
+ * @link https://engine.needle.tools/docs/blender/animation.html
82
+ */
50
83
  export class Animator extends Behaviour implements IAnimationComponent {
51
84
 
52
85
  /**
@@ -5,7 +5,7 @@ import { Camera } from "./Camera.js";
5
5
  import { Behaviour, GameObject } from "./Component.js";
6
6
 
7
7
  /**
8
- * AudioListener represents a listener that can hear audio sources in the scene.
8
+ * The [AudioListener](https://engine.needle.tools/docs/api/AudioListener) represents a listener that can hear audio sources in the scene.
9
9
  * This component creates and manages a Three.js {@link three#AudioListener}, automatically connecting it
10
10
  * to the main camera or a Camera in the parent hierarchy.
11
11
  *
@@ -37,24 +37,46 @@ export enum AudioRolloffMode {
37
37
  }
38
38
 
39
39
 
40
- /**
41
- * Plays audio clips in the scene, with support for spatial positioning.
42
- *
43
- * The AudioSource component can play audio files or media streams with
44
- * options for spatial blending, volume control, looping, and more.
45
- *
46
- * When a page loses visibility (tab becomes inactive), audio will automatically
47
- * pause unless {@link playInBackground} is set to true. On mobile devices, audio always
48
- * pauses regardless of this setting. When the page becomes visible again,
49
- * previously playing audio will resume.
50
- *
51
- * AudioSource also responds to application mute state changes. When the application
52
- * is muted, the volume is set to 0. When unmuted, the volume
53
- * returns to its previous value.
54
- *
40
+ /**
41
+ * Plays audio clips in the scene with support for spatial (3D) positioning.
42
+ *
43
+ * **Browser autoplay policies:**
44
+ * Web browsers require user interaction before playing audio. Use
45
+ * `AudioSource.userInteractionRegistered` to check if playback is allowed,
46
+ * or `registerWaitForAllowAudio()` to queue playback until interaction occurs.
47
+ *
48
+ * **Spatial audio:**
49
+ * Set `spatialBlend` to 1 for full 3D positioning, or 0 for 2D (non-spatial).
50
+ * Requires an {@link AudioListener} in the scene (typically on the camera).
51
+ *
52
+ * **Visibility handling:**
53
+ * Audio automatically pauses when the tab is hidden unless `playInBackground = true`.
54
+ * On mobile, audio always pauses in background regardless of this setting.
55
+ *
56
+ * @example Play audio on button click
57
+ * ```ts
58
+ * onClick() {
59
+ * const audio = this.getComponent(AudioSource);
60
+ * audio.play();
61
+ * }
62
+ * ```
63
+ *
64
+ * @example Wait for user interaction
65
+ * ```ts
66
+ * AudioSource.registerWaitForAllowAudio(() => {
67
+ * this.getComponent(AudioSource)?.play();
68
+ * });
69
+ * ```
70
+ *
55
71
  * @summary Plays audio clips from files or media streams
56
72
  * @category Multimedia
57
73
  * @group Components
74
+ * @see {@link AudioListener} for the audio receiver component
75
+ * @see {@link AudioRolloffMode} for distance attenuation options
76
+ * @see {@link Voip} for voice communication
77
+ * @see {@link PlayableDirector} for timeline-based audio
78
+ * @link https://engine.needle.tools/samples/?overlay=samples&tag=audio
79
+ * @link https://spatial-audio-zubckswmztj.needle.run/
58
80
  */
59
81
  export class AudioSource extends Behaviour {
60
82