@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
@@ -1,37 +1,55 @@
1
1
  import { Object3D, Vector3 } from "three";
2
2
 
3
3
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
+ import type { LookAt } from "./api.js";
4
5
  import { Behaviour } from "./Component.js";
5
6
  import type { OrbitControls } from "./OrbitControls.js";
6
7
 
7
8
  /**
8
- * A LookAtConstraint is used by OrbitControls to make the camera look at a target.
9
- * This component is used by {@link OrbitControls} internally.
10
- *
11
- * @summary Look At Constraint for OrbitControls
9
+ * The [LookAtConstraint](https://engine.needle.tools/docs/api/LookAtConstraint) component is primarely used by {@link OrbitControls} to set the camera's focus point.
10
+ * It does not have its own logic to update the look-at position.
11
+ *
12
+ * The constraint uses a list of source objects - the look-at target is
13
+ * calculated from the first source in the `sources` array.
14
+ *
15
+ * **Integration with OrbitControls:**
16
+ * When attached to the same GameObject as OrbitControls, this constraint
17
+ * controls where the camera orbits around and looks at.
18
+ *
19
+ * @summary Look At Constraint for camera targeting
12
20
  * @category Camera and Controls
13
21
  * @group Components
22
+ * @see {@link OrbitControls} for camera orbit controls
23
+ * @see {@link SmoothFollow} for smooth position/rotation following
24
+ * @see {@link LookAt} for directly making an object look at a target without using a constraint
14
25
  */
15
26
  export class LookAtConstraint extends Behaviour {
16
27
 
17
28
  /**
18
- * When true the constraint is active.
29
+ * When true, the constraint is active and affects the target.
30
+ * Set to false to temporarily disable without removing sources.
19
31
  */
20
32
  @serializable()
21
33
  constraintActive: boolean = true;
34
+
22
35
  /**
23
- * When true the look at is locked to the position of the assigned sources.
36
+ * When true, the look-at position is locked and won't update
37
+ * even if source objects move.
24
38
  */
25
39
  @serializable()
26
40
  locked: boolean = false;
41
+
27
42
  /**
28
- * The sources to look at.
43
+ * Objects to look at. The first object in the array is used
44
+ * as the primary look-at target.
29
45
  */
30
46
  @serializable(Object3D)
31
47
  sources: Object3D[] = [];
32
48
 
33
49
  /**
34
- * Set the position of the constraint.
50
+ * Sets the world position that the constraint should look at.
51
+ * Updates the first source object's position.
52
+ * @param worldPosition The world-space position to look at
35
53
  */
36
54
  setConstraintPosition(worldPosition: Vector3) {
37
55
  const source = this.sources[0];
@@ -3,16 +3,38 @@ import { serializable } from '../engine/engine_serialization.js';
3
3
  import { DeviceUtilities } from '../engine/engine_utils.js';
4
4
  import { Behaviour } from './Component.js';
5
5
 
6
- /**
7
- * Provides configuration options for the built-in Needle Menu.
8
- * Needle Menu uses HTML in 2D mode, and automatically switches to a 3D menu in VR/AR mode.
6
+ /**
7
+ * [NeedleMenu](https://engine.needle.tools/docs/api/NeedleMenu) provides configuration for the built-in UI menu.
8
+ * The menu renders as HTML overlay in browser mode and automatically
9
+ * switches to a 3D spatial menu in VR/AR.
9
10
  *
10
- * Controls display options, button visibility, and menu positioning.
11
- * From code, you can access the menu via {@link Context.menu}.
12
- *
13
- * @summary Configuration component for the Needle Menu
11
+ * ![](https://cloud.needle.tools/-/media/YKleg1oPy_I8Hv8sg_k40Q.png)
12
+ *
13
+ * **Features:**
14
+ * - Fullscreen toggle button
15
+ * - Audio mute/unmute button
16
+ * - QR code sharing (desktop only)
17
+ * - Spatial menu in XR (appears when looking up)
18
+ * - Custom positioning (top/bottom)
19
+ *
20
+ * **Programmatic access:**
21
+ * Access the menu API via `this.context.menu` to add custom buttons,
22
+ * show/hide elements, or modify behavior at runtime.
23
+ *
24
+ * @example Configure menu from code
25
+ * ```ts
26
+ * // Access the menu API
27
+ * this.context.menu.appendChild(myCustomButton);
28
+ * this.context.menu.setPosition("top");
29
+ * this.context.menu.showFullscreenOption(true);
30
+ * ```
31
+ *
32
+ * @summary Configuration component for the Needle Menu overlay
14
33
  * @category User Interface
15
34
  * @group Components
35
+ * @see {@link Context.menu} for programmatic menu control
36
+ * @see {@link Voip} adds a microphone button to the menu
37
+ * @see {@link ScreenCapture} adds a screen sharing button
16
38
  **/
17
39
  export class NeedleMenu extends Behaviour {
18
40
 
@@ -8,26 +8,62 @@ import { EventList } from "./EventList.js";
8
8
 
9
9
  const debug = getParam("debugnestedgltf");
10
10
 
11
- /** The nested gltf is a component that is used to load a gltf file when the component becomes active (start)
12
- * It will load the gltf file and instantiate it as a child of the parent of the GameObject that has this component
11
+ /**
12
+ * NestedGltf loads and instantiates a glTF file when the component starts.
13
+ * NestedGltf components are created by the Unity exporter when nesting Objects with the GltfObject component (in Unity).
14
+ * Use this for lazy-loading content, modular scene composition, or dynamic asset loading.
13
15
  *
16
+ * ![](https://cloud.needle.tools/-/media/lJKrr_2tWlqRFdFc46U4bQ.gif)
17
+ *
18
+ * The loaded glTF is instantiated as a sibling (child of parent) by default,
19
+ * inheriting the transform of the GameObject with this component.
20
+ *
21
+ * **Features:**
22
+ * - Automatic loading on start
23
+ * - Progress callbacks for loading UI
24
+ * - Preloading support for faster display
25
+ * - Event callback when loading completes
26
+ *
27
+ * @example Load a glTF when object becomes active
28
+ * ```ts
29
+ * const nested = myPlaceholder.addComponent(NestedGltf);
30
+ * nested.filePath = new AssetReference("models/furniture.glb");
31
+ * nested.loaded.addEventListener(({ instance }) => {
32
+ * console.log("Loaded:", instance.name);
33
+ * });
34
+ * ```
35
+ *
36
+ * @example Preload for instant display
37
+ * ```ts
38
+ * // Preload during loading screen
39
+ * await nested.preload();
40
+ * // Later, when object becomes active, it displays instantly
41
+ * ```
42
+ *
14
43
  * @summary Loads and instantiates a nested glTF file
15
44
  * @category Asset Management
16
45
  * @group Components
46
+ * @see {@link AssetReference} for asset loading utilities
47
+ * @see {@link SceneSwitcher} for scene-level loading
48
+ * @link https://engine.needle.tools/samples/hotspots
17
49
  */
18
50
  export class NestedGltf extends Behaviour {
19
51
 
20
- /** A reference to the gltf file that should be loaded */
52
+ /** Reference to the glTF file to load. Can be a URL or asset path. */
21
53
  @serializable(AssetReference)
22
54
  filePath?: AssetReference;
23
55
 
24
- /** Invoked when the nested glTF file has been instantiated */
56
+ /**
57
+ * Event fired when the glTF has been loaded and instantiated.
58
+ * Provides the component, loaded instance, and asset reference.
59
+ */
25
60
  @serializable(EventList)
26
61
  loaded: EventList<{ component: NestedGltf, instance: any, asset: AssetReference }> = new EventList();
27
62
 
28
63
  /**
29
64
  * EXPERIMENTAL for cloud asset loading
30
65
  */
66
+ @serializable()
31
67
  loadAssetInParent = true;
32
68
 
33
69
 
@@ -5,11 +5,35 @@ import * as utils from "./../engine/engine_three_utils.js";
5
5
  import { Behaviour, GameObject } from "./Component.js";
6
6
 
7
7
  /**
8
- * OffsetConstraint component allows an object to maintain a specified positional and rotational offset
9
- * relative to another object, with options for alignment and leveling.
10
- * @summary Maintains positional and rotational offset relative to another object
8
+ * The [OffsetConstraint](https://engine.needle.tools/docs/api/OffsetConstraint) maintains a fixed positional and rotational offset relative to a target object.
9
+ * Useful for attaching objects to moving targets while preserving a specific spatial relationship.
10
+ *
11
+ * **Use cases:**
12
+ * - Camera following a player with offset
13
+ * - UI elements attached to characters
14
+ * - Weapons attached to hands
15
+ * - Objects orbiting around a target
16
+ *
17
+ * **Options:**
18
+ * - `affectPosition` - Apply position offset
19
+ * - `affectRotation` - Apply rotation offset
20
+ * - `alignLookDirection` - Make object face same direction as target
21
+ * - `levelLookDirection` - Keep look direction horizontal (ignore pitch)
22
+ * - `levelPosition` - Project position onto horizontal plane
23
+ * - `referenceSpace` - Transform offset in this object's coordinate space
24
+ *
25
+ * @example Attach camera offset to player
26
+ * ```ts
27
+ * const constraint = camera.addComponent(OffsetConstraint);
28
+ * // Configure via serialized properties in editor
29
+ * ```
30
+ *
31
+ * @summary Maintains positional/rotational offset relative to target
11
32
  * @category Constraints
12
33
  * @group Components
34
+ * @see {@link SmoothFollow} for smoothed following
35
+ * @see {@link LookAtConstraint} for aim constraints
36
+ * @see {@link AlignmentConstraint} for alignment between two objects
13
37
  */
14
38
  export class OffsetConstraint extends Behaviour {
15
39
 
@@ -60,12 +60,50 @@ declare module 'three/examples/jsm/controls/OrbitControls.js' {
60
60
  }
61
61
  }
62
62
 
63
- /** The OrbitControls component is used to control a camera using the [OrbitControls from three.js](https://threejs.org/docs/#examples/en/controls/OrbitControls) library.
64
- * The three OrbitControls object can be accessed via the `controls` property.
65
- * The object being controlled by the OrbitControls (usually the camera) can be accessed via the `controllerObject` property.
63
+ /**
64
+ * [OrbitControls](https://engine.needle.tools/docs/api/OrbitControls) provides interactive camera control using three.js OrbitControls.
65
+ * Users can rotate, pan, and zoom the camera to explore 3D scenes.
66
+ *
67
+ * **Features:**
68
+ * - Rotation around a target point (orbit)
69
+ * - Panning to move the view
70
+ * - Zooming via scroll or pinch
71
+ * - Auto-rotation for showcases
72
+ * - Configurable angle and distance limits
73
+ * - Smooth damping for natural feel
74
+ *
75
+ * ![](https://cloud.needle.tools/-/media/ylC34hrC3srwyzGNhFRbEQ.gif)
76
+ *
77
+ * **Access underlying controls:**
78
+ * - `controls` - The three.js OrbitControls instance
79
+ * - `controllerObject` - The object being controlled (usually the camera)
80
+ *
81
+ * **Debug options:**
82
+ * - `?debugorbit` - Log orbit control events
83
+ * - `?freecam` - Enable unrestricted camera movement
84
+ *
85
+ * @example Basic setup
86
+ * ```ts
87
+ * const orbitControls = camera.getComponent(OrbitControls);
88
+ * orbitControls.autoRotate = true;
89
+ * orbitControls.autoRotateSpeed = 2;
90
+ * ```
91
+ *
92
+ * @example Set look-at target
93
+ * ```ts
94
+ * orbitControls.setLookTargetPosition(new Vector3(0, 1, 0), true);
95
+ * // Or move both camera and target
96
+ * orbitControls.setCameraTargetPosition(new Vector3(5, 2, 5), new Vector3(0, 0, 0));
97
+ * ```
98
+ *
66
99
  * @summary Camera controller using three.js OrbitControls
67
100
  * @category Camera and Controls
68
101
  * @group Components
102
+ * @see {@link LookAtConstraint} for setting the look-at target
103
+ * @see {@link SmoothFollow} for smooth camera following
104
+ * @see {@link Camera} for camera configuration
105
+ * @link https://threejs.org/docs/#examples/en/controls/OrbitControls
106
+ * @link https://engine.needle.tools/samples/panorama-controls alternative controls in samples
69
107
  */
70
108
  export class OrbitControls extends Behaviour implements ICameraController {
71
109
 
@@ -7,7 +7,7 @@ import { Behaviour, GameObject } from "./Component.js";
7
7
  import { AvatarMarker } from "./webxr/WebXRAvatar.js";
8
8
 
9
9
  /**
10
- * PlayerColor assigns a unique color for each user in the room to the object it is attached to.
10
+ * [PlayerColor](https://engine.needle.tools/docs/api/PlayerColor) Assigns a unique color for each user in the room to the object it is attached to.
11
11
  * The color is generated based on the user's ID.
12
12
  *
13
13
  * @summary Assigns a unique color to the player object
@@ -15,13 +15,28 @@ const $reflectionProbeKey = Symbol("reflectionProbeKey");
15
15
  const $originalMaterial = Symbol("original material");
16
16
 
17
17
  /**
18
- * A ReflectionProbe provides reflection data to materials within its defined area.
19
- *
20
- * - Sample: http://samples.needle.tools/reflection-probes
21
- *
18
+ * The [ReflectionProbe](https://engine.needle.tools/docs/api/ReflectionProbe) provides environment reflection data to materials within its defined area.
19
+ * Use for chrome-like materials that need accurate environment reflections.
20
+ *
21
+ * **Setup:**
22
+ * 1. Add ReflectionProbe component to an object
23
+ * 2. Assign a cubemap or HDR texture
24
+ * 3. In Renderer components, assign the probe as anchor override
25
+ *
26
+ * **Note:** Volume-based automatic assignment is not fully supported yet.
27
+ * Objects (Renderer components) can explicitly reference their reflection probe.
28
+ *
29
+ * **Debug options:**
30
+ * - `?debugreflectionprobe` - Log probe info
31
+ * - `?noreflectionprobe` - Disable all reflection probes
32
+ *
33
+ * - Example: https://engine.needle.tools/samples/reflection-probes
34
+ *
22
35
  * @summary Provides reflection data to materials
23
36
  * @category Rendering
24
37
  * @group Components
38
+ * @see {@link Renderer} for material and rendering control
39
+ * @see {@link Light} for scene lighting
25
40
  */
26
41
  export class ReflectionProbe extends Behaviour {
27
42
 
@@ -45,7 +60,6 @@ export class ReflectionProbe extends Behaviour {
45
60
  return probe;
46
61
  }
47
62
  }
48
- // TODO not supported right now, as we'd have to pass the ReflectionProbe scale through as well.
49
63
  else if (probe.isInBox(object)) {
50
64
  if (debug) console.log("Found reflection probe", object.name, probe.name);
51
65
  return probe;
@@ -200,8 +200,43 @@ class SharedMaterialArray implements ISharedMaterials {
200
200
  }
201
201
 
202
202
  /**
203
+ * The [Renderer](https://engine.needle.tools/docs/api/Renderer) component controls rendering properties of meshes including materials,
204
+ * lightmaps, reflection probes, and GPU instancing.
205
+ *
206
+ * **Materials:**
207
+ * Access materials via `sharedMaterials` array. Changes affect all instances.
208
+ * Use material cloning for per-instance variations.
209
+ *
210
+ * **Instancing:**
211
+ * Enable GPU instancing for improved performance with many identical objects.
212
+ * Use `Renderer.setInstanced(obj, true)` or `enableInstancing` property.
213
+ *
214
+ * **Lightmaps:**
215
+ * Baked lighting is automatically applied when exported from Unity or Blender.
216
+ * Access via the associated {@link RendererLightmap} component.
217
+ *
218
+ * [![](https://cloud.needle.tools/-/media/Vk944XVswtPEuxlNPLMxPQ.gif)](https://engine.needle.tools/samples/multiple-lightmaps/)
219
+ *
220
+ * **Debug options:**
221
+ * - `?debugrenderer` - Log renderer info
222
+ * - `?wireframe` - Show wireframe rendering
223
+ * - `?noinstancing` - Disable GPU instancing
224
+ *
225
+ * @example Change material at runtime
226
+ * ```ts
227
+ * const renderer = myObject.getComponent(Renderer);
228
+ * renderer.sharedMaterials[0] = newMaterial;
229
+ * ```
230
+ *
231
+ * @example Enable instancing
232
+ * ```ts
233
+ * Renderer.setInstanced(myObject, true);
234
+ * ```
235
+ *
203
236
  * @category Rendering
204
237
  * @group Components
238
+ * @see {@link ReflectionProbe} for environment reflections
239
+ * @see {@link Light} for scene lighting
205
240
  */
206
241
  export class Renderer extends Behaviour implements IRenderer {
207
242
 
@@ -691,7 +726,6 @@ export class Renderer extends Behaviour implements IRenderer {
691
726
  }
692
727
 
693
728
  if (this.reflectionProbeUsage !== ReflectionProbeUsage.Off && this._reflectionProbe) {
694
- if (!this._lightmaps?.length) // Currently reflectionprobes cant be used with lightmaps
695
729
  this._reflectionProbe.onSet(this);
696
730
  }
697
731
  // since three 163 we need to set the envMap to the scene envMap if it is not set
@@ -2,14 +2,18 @@ import { Matrix4, Object3D, Quaternion, Vector3, Vector3Like } from "three";
2
2
 
3
3
  import { isDevEnvironment } from "../engine/debug/index.js";
4
4
  import { MODULES } from "../engine/engine_modules.js";
5
+ import type { Physics } from "../engine/engine_physics.js";
5
6
  import { CollisionDetectionMode, RigidbodyConstraints } from "../engine/engine_physics.types.js";
7
+ import type { RapierPhysics } from "../engine/engine_physics_rapier.js";
6
8
  import { serializable } from "../engine/engine_serialization_decorator.js";
7
9
  import { Context, FrameEvent } from "../engine/engine_setup.js";
8
- import { getWorldPosition } from "../engine/engine_three_utils.js";
9
10
  import type { IRigidbody, Vec3 } from "../engine/engine_types.js";
10
11
  import { validate } from "../engine/engine_util_decorator.js";
11
12
  import { delayForFrames, Watch } from "../engine/engine_utils.js";
13
+ import type { CharacterController } from "./CharacterController.js";
14
+ import type { BoxCollider, CapsuleCollider, Collider,MeshCollider, SphereCollider } from "./Collider.js";
12
15
  import { Behaviour } from "./Component.js";
16
+ import type { Joint } from "./Joints.js";
13
17
 
14
18
  class TransformWatch {
15
19
 
@@ -134,15 +138,67 @@ class TransformWatch {
134
138
  }
135
139
 
136
140
  /**
137
- * A Rigidbody is used together with a Collider to create physical interactions between objects in the scene.
141
+ * Rigidbody component for realistic physics simulation and dynamic interactions.
142
+ * Used together with a {@link Collider} to enable physical behavior like gravity, collisions,
143
+ * forces, and constraints. Powered by the Rapier physics engine.
138
144
  *
139
- * - Example: https://samples.needle.tools/physics-basic
140
- * - Example: https://samples.needle.tools/physics-playground
141
- * - Example: https://samples.needle.tools/physics-&-animation
142
- *
143
- * @summary Rigidbody for physical interactions
144
- * @category Physics
145
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
146
+ *
147
+ * **Key features:**
148
+ * - Dynamic, kinematic, or static body types
149
+ * - Automatic or manual mass calculation
150
+ * - Gravity, drag, and angular drag control
151
+ * - Position and rotation constraints (locking axes)
152
+ * - Force, impulse, and velocity manipulation
153
+ * - Sleep/wake optimization for performance
154
+ * - Continuous collision detection (CCD) support
155
+ *
156
+ * @example Basic dynamic rigidbody
157
+ * ```ts
158
+ * const rb = this.gameObject.getComponent(Rigidbody);
159
+ * rb.useGravity = true;
160
+ * rb.mass = 2.0;
161
+ * rb.drag = 0.5;
162
+ * ```
163
+ *
164
+ * @example Apply force to move object
165
+ * ```ts
166
+ * const rb = this.gameObject.getComponent(Rigidbody);
167
+ * rb.applyForce(new Vector3(0, 10, 0)); // Upward force
168
+ * rb.applyImpulse(new Vector3(5, 0, 0)); // Instant velocity change
169
+ * ```
170
+ *
171
+ * @example Kinematic rigidbody (manually controlled)
172
+ * ```ts
173
+ * const rb = this.gameObject.getComponent(Rigidbody);
174
+ * rb.isKinematic = true; // Not affected by forces
175
+ * rb.teleport({ x: 0, y: 5, z: 0 }); // Move without physics
176
+ * ```
177
+ *
178
+ * @example Lock rotation on Y axis (useful for characters)
179
+ * ```ts
180
+ * const rb = this.gameObject.getComponent(Rigidbody);
181
+ * rb.lockRotationY = true;
182
+ * // Or use constraints for multiple axes:
183
+ * rb.constraints = RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezePositionZ;
184
+ * ```
185
+ *
186
+ * @summary Enables physics simulation with forces, gravity, and collisions
187
+ * @category Physics
145
188
  * @group Components
189
+ * @see {@link BoxCollider} for box-shaped colliders
190
+ * @see {@link SphereCollider} for sphere-shaped colliders
191
+ * @see {@link CapsuleCollider} for capsule-shaped colliders
192
+ * @see {@link MeshCollider} for mesh-based colliders
193
+ * @see {@link Collider} for collider base class
194
+ * @see {@link CharacterController} for character movement
195
+ * @see {@link Joint} for connecting bodies
196
+ * @see {@link RapierPhysics} for physics engine implementation
197
+ * @see {@link Physics} for raycasting and physics utilities
198
+ * @link https://engine.needle.tools/samples/physics-basic/
199
+ * @link https://engine.needle.tools/samples/physics-playground/
200
+ * @link https://engine.needle.tools/samples/physics-&-animation/
201
+ * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies
146
202
  */
147
203
  export class Rigidbody extends Behaviour implements IRigidbody {
148
204
 
@@ -84,6 +84,13 @@ export interface ISceneEventListener {
84
84
  * - [Needle Website](https://needle.tools)
85
85
  * - [Songs Of Cultures](https://app.songsofcultures.com)
86
86
  *
87
+ * ![](https://cloud.needle.tools/-/media/I-atrBcwIcg2kfvPl8c71A.gif)
88
+ * *Replace entire scenes with the SceneSwitcher.*
89
+ *
90
+ * ![](https://cloud.needle.tools/-/media/_FbH-7pkDmluTdfphXlP-A.gif)
91
+ * *Multiple SceneSwitcher components can be used at the same time and they can also be nested
92
+ * (a scene loaded by a SceneSwitcher can also have a SceneSwitcher to load sub-scenes).*
93
+ *
87
94
  * ### Interfaces
88
95
  * Use the {@link ISceneEventListener} interface to listen to scene open and closing events with the ability to modify transitions and stall the scene loading process.
89
96
  *
@@ -111,6 +118,10 @@ export interface ISceneEventListener {
111
118
  * @summary Dynamically loads and switches between multiple scenes
112
119
  * @category Asset Management
113
120
  * @group Components
121
+ * @see {@link ISceneEventListener} for scene transition callbacks
122
+ * @see {@link AssetReference} for loading individual assets
123
+ * @see {@link NestedGltf} for embedding static glTF content
124
+ * @link https://engine.needle.tools/docs/how-to-guides/components/scene-switcher.html
114
125
  */
115
126
  export class SceneSwitcher extends Behaviour {
116
127
 
@@ -61,19 +61,52 @@ export declare type ScreenCaptureOptions = {
61
61
  deviceFilter?: (device: MediaDeviceInfo) => boolean,
62
62
  }
63
63
 
64
- /**
65
- * The ScreenCapture component allows you to share your screen, camera or microphone with other users in the networked room.
66
- * When the stream is active the video will be displayed on the VideoPlayer component attached to the same GameObject.
67
- *
68
- * Note: For debugging append `?debugscreensharing` to the URL to see more information in the console.
69
- *
70
- * By default the component will start sharing the screen when the user clicks on the object this component is attached to. You can set {@link device} This behaviour can be disabled by setting `allowStartOnClick` to false.
71
- * It is also possible to start the stream manually from your code by calling the {@link share} method.
64
+ /**
65
+ * ScreenCapture enables sharing screen, camera, or microphone with users in a networked room.
66
+ * The stream is displayed via a {@link VideoPlayer} component on the same GameObject.
67
+ *
68
+ * **Supported capture devices:**
69
+ * - `Screen` - Share desktop/window/tab
70
+ * - `Camera` - Share webcam feed
71
+ * - `Microphone` - Audio only
72
+ * - `Canvas` - Share the 3D canvas (experimental)
72
73
  *
74
+ * ![](https://cloud.needle.tools/-/media/Ugw6sKj3KNeLMzl0yKQXig.gif)
75
+ *
76
+ * **How it works:**
77
+ * - Click the object to start/stop sharing (if `allowStartOnClick` is true)
78
+ * - Or call `share()` / `close()` programmatically
79
+ * - Stream is sent to all users in the same room via WebRTC
80
+ * - Receiving clients see the video on their VideoPlayer
81
+ *
82
+ * **Debug:** Append `?debugscreensharing` to the URL for console logging.
83
+ *
84
+ * @example Start screen sharing programmatically
85
+ * ```ts
86
+ * const capture = myScreen.getComponent(ScreenCapture);
87
+ * await capture?.share({ device: "Screen" });
88
+ *
89
+ * // Later, stop sharing
90
+ * capture?.close();
91
+ * ```
92
+ *
93
+ * @example Share webcam with constraints
94
+ * ```ts
95
+ * await capture?.share({
96
+ * device: "Camera",
97
+ * constraints: { width: 1280, height: 720 }
98
+ * });
99
+ * ```
100
+ *
73
101
  * @summary Share screen, camera or microphone in a networked room
74
102
  * @category Networking
103
+ * @category Multimedia
75
104
  * @group Components
76
- */
105
+ * @see {@link VideoPlayer} for displaying the received stream
106
+ * @see {@link Voip} for voice-only communication
107
+ * @see {@link SyncedRoom} for room management
108
+ * @link https://engine.needle.tools/docs/networking.html
109
+ */
77
110
  export class ScreenCapture extends Behaviour implements IPointerClickHandler {
78
111
 
79
112
  /**
@@ -6,9 +6,11 @@ import { serializable } from "../engine/engine_serialization_decorator.js";
6
6
  import { getTempVector } from "../engine/engine_three_utils.js";
7
7
  import { getParam } from "../engine/engine_utils.js";
8
8
  import { USDObject, USDZExporterContext } from "./api.js";
9
+ import type { Camera } from "./Camera.js";
9
10
  import { Behaviour } from "./Component.js";
10
11
  import { IUSDExporterExtension } from "./export/usdz/Extension.js";
11
12
  import { USDZExporter } from "./export/usdz/USDZExporter.js";
13
+ import type { OrbitControls } from "./OrbitControls.js";
12
14
  import { Renderer } from "./Renderer.js";
13
15
 
14
16
  const debugSeeThrough = getParam("debugseethrough");
@@ -32,17 +34,82 @@ let i = 0;
32
34
 
33
35
 
34
36
  /**
35
- * Makes the object fade out when it is obscuring the reference point from the camera. This component can be put on any object in the scene. It will affect all Renderer components on the same object and child objects.
36
- *
37
- * Useful for e.g. making walls transparent when the camera is outside or hiding object's that would otherwise block the view.
38
- *
39
- * Requires a Renderer component on the same object or a child object.
40
- *
41
- * - Example https://see-through-walls-z23hmxbz1kjfjn.needle.run/
42
- *
43
- * @summary Makes objects fade out when obscuring a reference point from the camera
37
+ * Automatically fades objects to transparent when they obscure a reference point from the camera's view.
38
+ * Perfect for architectural visualization, third-person games, or any scenario where objects should
39
+ * become see-through when blocking the view of important content.
40
+ *
41
+ * [![](https://cloud.needle.tools/-/media/1gbMOJLgTlXOug_g6xeKfg.gif)](https://engine.needle.tools/samples/see-through)
42
+ *
43
+ * **How it works:**
44
+ * - Monitors the angle between the camera, this object, and a reference point
45
+ * - When the object blocks the view to the reference point, it fades out
46
+ * - Automatically affects all {@link Renderer} components on this object and children
47
+ * - Supports both transparent fading and alpha hash (dithered) fading
48
+ *
49
+ * **Key Features:**
50
+ * - Smooth fade transitions with configurable duration
51
+ * - Optional alpha hash for maintaining opaque rendering (better performance)
52
+ * - Automatic or manual update modes
53
+ * - Disables raycasting when faded (objects become click-through)
54
+ * - Preserves original material properties when re-enabled
55
+ *
56
+ * **Configuration:**
57
+ * - `referencePoint` - Object to keep visible (defaults to scene root)
58
+ * - `fadeDuration` - Transition speed (default: 0.05 seconds)
59
+ * - `minAlpha` - Minimum opacity when faded (default: 0 = fully transparent)
60
+ * - `useAlphaHash` - Use dithered transparency instead of true transparency (default: true)
61
+ *
62
+ * **Performance:**
63
+ * - Materials are cloned once per renderer to avoid affecting shared materials
64
+ * - Updates direction calculation every 20 frames by default (configurable via `autoUpdate`)
65
+ * - Use `needsUpdate = true` to force immediate recalculation
66
+ *
67
+ * **Requirements:**
68
+ * Requires at least one {@link Renderer} component on the same object or child objects.
69
+ *
70
+ * @example Make walls transparent when blocking view
71
+ * ```ts
72
+ * // Add to walls or obstacles
73
+ * const seeThrough = wall.addComponent(SeeThrough);
74
+ * seeThrough.referencePoint = player; // Keep player visible
75
+ * seeThrough.fadeDuration = 0.2; // Smooth fade
76
+ * seeThrough.minAlpha = 0.2; // Slightly visible when faded
77
+ * ```
78
+ *
79
+ * @example Third-person camera with see-through objects
80
+ * ```ts
81
+ * const character = GameObject.findByName("Character");
82
+ * const obstacles = GameObject.findByTag("Obstacle");
83
+ *
84
+ * for (const obstacle of obstacles) {
85
+ * const st = obstacle.addComponent(SeeThrough);
86
+ * st.referencePoint = character;
87
+ * st.useAlphaHash = true; // Better performance
88
+ * }
89
+ * ```
90
+ *
91
+ * @example Manual control of see-through effect
92
+ * ```ts
93
+ * const seeThrough = this.gameObject.getComponent(SeeThrough);
94
+ * if (seeThrough) {
95
+ * seeThrough.autoUpdate = false; // Disable automatic fading
96
+ *
97
+ * // Manually control transparency
98
+ * seeThrough.updateAlpha(0.5, 0.3); // Fade to 50% over 0.3 seconds
99
+ *
100
+ * // Or use override for precise control
101
+ * seeThrough.overrideAlpha = 0.8; // Force 80% opacity
102
+ * }
103
+ * ```
104
+ *
105
+ * @summary Fades objects when they obscure the camera's view of a reference point
44
106
  * @category Rendering
45
107
  * @group Components
108
+ * @see {@link Renderer} for material/rendering control (required)
109
+ * @see {@link Camera} for camera setup and configuration
110
+ * @see {@link OrbitControls} for camera controls in similar use cases
111
+ * @link https://see-through-walls-z23hmxbz1kjfjn.needle.run/ for live demo
112
+ * @link https://engine.needle.tools/samples/see-through for sample project
46
113
  */
47
114
  export class SeeThrough extends Behaviour {
48
115