@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
@@ -5,12 +5,31 @@ import { serializable } from "../engine/engine_serialization_decorator.js";
5
5
  import { Behaviour } from "./Component.js";
6
6
 
7
7
  /**
8
- * Component that visualizes the axes of an object in the scene.
9
- * Renders colored lines representing the X (red), Y (green) and Z (blue) axes.
10
- *
11
- * @summary Visualizes object axes in the scene
8
+ * The [AxesHelper](https://engine.needle.tools/docs/api/AxesHelper) visualizes the local coordinate axes of an object.
9
+ * Displays colored lines for X (red), Y (green), and Z (blue) axes.
10
+ *
11
+ * **Use cases:**
12
+ * - Debugging object orientation and rotation
13
+ * - Visualizing pivot points
14
+ * - Understanding coordinate systems
15
+ *
16
+ * **Properties:**
17
+ * - `length` - Length of axis lines in world units
18
+ * - `depthTest` - Whether axes are occluded by scene objects
19
+ * - `isGizmo` - Only show when `?gizmos` URL parameter is set
20
+ *
21
+ * @example Add axes visualization
22
+ * ```ts
23
+ * const axes = myObject.addComponent(AxesHelper);
24
+ * axes.length = 2;
25
+ * axes.depthTest = false; // Always visible on top
26
+ * ```
27
+ *
28
+ * @summary Visualizes object axes (X=red, Y=green, Z=blue)
12
29
  * @category Helpers
13
30
  * @group Components
31
+ * @see {@link GridHelper} for grid visualization
32
+ * @see {@link Gizmos} for debug drawing utilities
14
33
  */
15
34
  export class AxesHelper extends Behaviour {
16
35
  /**
@@ -4,12 +4,35 @@ import * as utils from "./../engine/engine_three_utils.js";
4
4
  import { Behaviour, GameObject } from "./Component.js";
5
5
 
6
6
  /**
7
- * BasicIKConstraint positions the GameObject between two target GameObjects (`from` and `to`) with an optional `hint` GameObject to guide the bending direction.
8
- * This is useful for simple inverse kinematics setups, such as positioning a joint in a limb.
9
- *
10
- * @summary Simple Inverse Kinematics Constraint
11
- * @category Animation
7
+ * The [BasicIKConstraint](https://engine.needle.tools/docs/api/BasicIKConstraint) provides simple two-bone inverse kinematics.
8
+ * Positions this GameObject as a "joint" between `from` and `to` targets,
9
+ * using a `hint` object to determine the bend direction.
10
+ *
11
+ * **Use cases:**
12
+ * - Simple arm/leg IK (elbow/knee positioning)
13
+ * - Mechanical linkages
14
+ * - Procedural animation joints
15
+ *
16
+ * **How it works:**
17
+ * - Calculates joint position based on `desiredDistance` (bone length)
18
+ * - Uses `hint` to determine which way the joint bends
19
+ * - Automatically handles stretching when targets are too far apart
20
+ *
21
+ * @example Setup basic limb IK
22
+ * ```ts
23
+ * // Attach to the elbow/knee joint object
24
+ * const ik = elbowJoint.addComponent(BasicIKConstraint);
25
+ * // Configure via serialized properties in editor:
26
+ * // - from: shoulder/hip
27
+ * // - to: wrist/ankle
28
+ * // - hint: control point for bend direction
29
+ * ```
30
+ *
31
+ * @summary Two-bone inverse kinematics constraint
32
+ * @category Animation and Sequencing
12
33
  * @group Components
34
+ * @see {@link LookAtConstraint} for aim constraints
35
+ * @see {@link AlignmentConstraint} for simpler alignment
13
36
  */
14
37
  export class BasicIKConstraint extends Behaviour {
15
38
 
@@ -32,13 +32,43 @@ const debug = getParam("debugcam");
32
32
  const debugscreenpointtoray = getParam("debugscreenpointtoray");
33
33
 
34
34
  /**
35
- * Camera component that handles rendering from a specific viewpoint in the scene.
36
- * Supports both perspective and orthographic cameras with various rendering options.
37
- * Internally, this component uses {@link PerspectiveCamera} and {@link OrthographicCamera} three.js objects.
35
+ * [Camera](https://engine.needle.tools/docs/api/Camera) handles rendering from a specific viewpoint in the scene.
36
+ * Supports both perspective and orthographic cameras with various rendering options.
37
+ * Internally uses three.js {@link PerspectiveCamera} or {@link OrthographicCamera}.
38
38
  *
39
+ * ![](https://cloud.needle.tools/-/media/UU96_SJNXdVjaAvPNW3kZA.webp)
40
+ *
41
+ * **Background clearing:**
42
+ * Control how the camera clears the background using `clearFlags`:
43
+ * - `Skybox` - Use scene skybox/environment
44
+ * - `SolidColor` - Clear with `backgroundColor`
45
+ * - `None` - Don't clear (for layered rendering)
46
+ *
47
+ * **Render targets:**
48
+ * Set `targetTexture` to a {@link RenderTexture} to render to a texture
49
+ * instead of the screen (useful for mirrors, portals, minimaps).
50
+ *
51
+ * [![](https://cloud.needle.tools/-/media/W4tYZuJVVJFVp7NTaHPOnA.gif)](https://engine.needle.tools/samples/movie-set)
52
+ *
53
+ * @example Configure camera settings
54
+ * ```ts
55
+ * const cam = this.context.mainCameraComponent;
56
+ * cam.fieldOfView = 60;
57
+ * cam.nearClipPlane = 0.1;
58
+ * cam.farClipPlane = 1000;
59
+ * cam.clearFlags = ClearFlags.SolidColor;
60
+ * cam.backgroundColor = new RGBAColor(0.1, 0.1, 0.2, 1);
61
+ * ```
62
+ *
63
+ * - Example: https://engine.needle.tools/samples/multiple-cameras
64
+ *
39
65
  * @summary Rendering scenes from a specific viewpoint
40
66
  * @category Camera and Controls
41
67
  * @group Components
68
+ * @see {@link OrbitControls} for camera interaction
69
+ * @see {@link RenderTexture} for off-screen rendering
70
+ * @see {@link ClearFlags} for background clearing options
71
+ * @link https://engine.needle.tools/samples/movie-set/
42
72
  */
43
73
  export class Camera extends Behaviour implements ICamera {
44
74
 
@@ -14,18 +14,49 @@ import { Rigidbody } from "./RigidBody.js";
14
14
  const debug = getParam("debugcharactercontroller");
15
15
 
16
16
  /**
17
- * CharacterController adds a capsule collider and rigidbody to the object, constrains rotation, and provides movement and grounded state.
18
- * It is designed for typical character movement in 3D environments.
17
+ * The [CharacterController](https://engine.needle.tools/docs/api/CharacterController) adds a capsule collider and rigidbody to the object, constrains rotation, and provides movement and grounded state.
18
+ * It is designed for typical character movement in 3D environments.
19
+ *
20
+ * The controller automatically:
21
+ * - Creates a {@link CapsuleCollider} if one doesn't exist
22
+ * - Creates a {@link Rigidbody} if one doesn't exist
23
+ * - Locks rotation on all axes to prevent tipping over
24
+ * - Tracks ground contact for jump detection
25
+ *
26
+ * @example Basic character movement
27
+ * ```ts
28
+ * export class MyCharacter extends Behaviour {
29
+ * @serializable(CharacterController)
30
+ * controller?: CharacterController;
31
+ *
32
+ * update() {
33
+ * const input = this.context.input;
34
+ * const move = new Vector3();
35
+ * if (input.isKeyPressed("KeyW")) move.z = 0.1;
36
+ * if (input.isKeyPressed("KeyS")) move.z = -0.1;
37
+ * this.controller?.move(move);
38
+ * }
39
+ * }
40
+ * ```
41
+ *
19
42
  * @summary Character Movement Controller
20
- * @category Character
43
+ * @category Character
21
44
  * @group Components
45
+ * @see {@link CharacterControllerInput} for ready-to-use input handling
46
+ * @see {@link Rigidbody} for physics configuration
47
+ * @see {@link CapsuleCollider} for collision shape
22
48
  */
23
49
  export class CharacterController extends Behaviour {
24
50
 
51
+ /** Center offset of the capsule collider in local space */
25
52
  @serializable(Vector3)
26
53
  center: Vector3 = new Vector3(0, 0, 0);
54
+
55
+ /** Radius of the capsule collider */
27
56
  @serializable()
28
57
  radius: number = .5;
58
+
59
+ /** Height of the capsule collider */
29
60
  @serializable()
30
61
  height: number = 2;
31
62
 
@@ -70,6 +101,11 @@ export class CharacterController extends Behaviour {
70
101
  rb.lockRotationZ = true;
71
102
  }
72
103
 
104
+ /**
105
+ * Moves the character by adding the given vector to its position.
106
+ * Movement is applied directly without physics simulation.
107
+ * @param vec The movement vector to apply
108
+ */
73
109
  move(vec: Vector3) {
74
110
  this.gameObject.position.add(vec);
75
111
  }
@@ -92,9 +128,15 @@ export class CharacterController extends Behaviour {
92
128
  }
93
129
  }
94
130
 
131
+ /** Returns true if the character is currently touching the ground */
95
132
  get isGrounded(): boolean { return this._activeGroundCollisions.size > 0; }
96
133
 
97
134
  private _contactVelocity: Vector3 = new Vector3();
135
+
136
+ /**
137
+ * Returns the combined velocity of all objects the character is standing on.
138
+ * Useful for moving platforms - add this to your movement for proper platform riding.
139
+ */
98
140
  get contactVelocity(): Vector3 {
99
141
  this._contactVelocity.set(0, 0, 0);
100
142
  for (const col of this._activeGroundCollisions) {
@@ -110,31 +152,56 @@ export class CharacterController extends Behaviour {
110
152
  }
111
153
 
112
154
  /**
113
- * CharacterControllerInput handles user input to control a CharacterController.
114
- * It supports movement, looking around, jumping, and double jumping.
115
- * You can customize movement speed, rotation speed, and jump forces.
116
- * It also integrates with an Animator component for character animations.
155
+ * CharacterControllerInput handles user input to control a {@link CharacterController}.
156
+ * It supports movement, looking around, jumping, and double jumping.
157
+ *
158
+ * Default controls:
159
+ * - **W/S**: Move forward/backward
160
+ * - **A/D**: Rotate left/right
161
+ * - **Space**: Jump (supports double jump)
162
+ *
163
+ * The component automatically sets animator parameters:
164
+ * - `running` (bool): True when moving
165
+ * - `jumping` (bool): True when starting a jump
166
+ * - `doubleJump` (bool): True during double jump
167
+ * - `falling` (bool): True when falling from height
168
+ *
169
+ * @example Custom input handling
170
+ * ```ts
171
+ * const input = this.gameObject.getComponent(CharacterControllerInput);
172
+ * input?.move(new Vector2(0, 1)); // Move forward
173
+ * input?.jump(); // Trigger jump
174
+ * ```
175
+ *
117
176
  * @summary User Input for Character Controller
118
177
  * @category Character
119
178
  * @group Components
179
+ * @see {@link CharacterController} for the movement controller
180
+ * @see {@link Animator} for animation integration
120
181
  */
121
182
  export class CharacterControllerInput extends Behaviour {
122
183
 
184
+ /** The CharacterController to drive with input */
123
185
  @serializable(CharacterController)
124
186
  controller?: CharacterController;
125
187
 
188
+ /** Movement speed multiplier */
126
189
  @serializable()
127
190
  movementSpeed: number = 2;
128
191
 
192
+ /** Rotation speed multiplier */
129
193
  @serializable()
130
194
  rotationSpeed: number = 2;
131
195
 
196
+ /** Impulse force applied when jumping from ground */
132
197
  @serializable()
133
198
  jumpForce: number = 1;
134
199
 
200
+ /** Impulse force applied for the second jump (set to 0 to disable double jump) */
135
201
  @serializable()
136
202
  doubleJumpForce: number = 2;
137
203
 
204
+ /** Optional Animator for character animations */
138
205
  @serializable(Animator)
139
206
  animator?: Animator;
140
207
 
@@ -14,17 +14,43 @@ import { Behaviour } from "./Component.js";
14
14
  import { Rigidbody } from "./RigidBody.js";
15
15
 
16
16
  /**
17
- * Collider is the base class for all colliders. A collider is a physical shape that is used to detect collisions with other objects in the scene.
18
- * Colliders are used in combination with a {@link Rigidbody} to create physical interactions between objects.
19
- * Colliders are registered with the physics engine when they are enabled and removed when they are disabled.
17
+ * Collider is the base class for all physics collision shapes.
18
+ * Colliders define the physical boundary of objects for collision detection.
20
19
  *
20
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
21
+ *
22
+ * **Usage with Rigidbody:**
23
+ * - Add a collider to define collision shape
24
+ * - Add a {@link Rigidbody} to the same or parent object for physics simulation
25
+ * - Without Rigidbody, collider acts as static geometry
26
+ *
27
+ * **Trigger mode:**
28
+ * Set `isTrigger = true` for detection without physical collision.
29
+ * Triggers fire `onTriggerEnter`, `onTriggerStay`, `onTriggerExit` events.
30
+ *
31
+ * **Collision filtering:**
32
+ * Use `membership` and `filter` arrays to control which objects collide.
33
+ *
34
+ * @example Add a box collider to an object
35
+ * ```ts
36
+ * const collider = myObject.addComponent(BoxCollider);
37
+ * collider.size = new Vector3(1, 2, 1);
38
+ * collider.center = new Vector3(0, 1, 0);
39
+ * ```
40
+ *
21
41
  * - Example: https://samples.needle.tools/physics-basic
22
42
  * - Example: https://samples.needle.tools/physics-playground
23
- * - Example: https://samples.needle.tools/physics-&-animation
24
- *
25
- * @summary Physics collider
26
- * @category Physics
43
+ *
44
+ * @summary Physics collider base class
45
+ * @category Physics
27
46
  * @group Components
47
+ * @see {@link BoxCollider} for box-shaped colliders
48
+ * @see {@link SphereCollider} for sphere-shaped colliders
49
+ * @see {@link CapsuleCollider} for capsule-shaped colliders
50
+ * @see {@link MeshCollider} for mesh-based colliders
51
+ * @see {@link Rigidbody} for physics simulation
52
+ * @link https://engine.needle.tools/samples/?room=needle272&overlay=samples&tag=physics
53
+ * @link https://engine.needle.tools/samples-uploads/basic-physics/?showcolliders
28
54
  */
29
55
  export abstract class Collider extends Behaviour implements ICollider {
30
56
 
@@ -116,15 +142,26 @@ export abstract class Collider extends Behaviour implements ICollider {
116
142
  }
117
143
 
118
144
  /**
119
- * SphereCollider represents a sphere-shaped collision volume.
120
- * Useful for objects that are roughly spherical in shape or need a simple collision boundary.
145
+ * SphereCollider represents a sphere-shaped collision volume.
146
+ * Efficient and suitable for balls, projectiles, or approximate collision bounds.
121
147
  *
148
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
149
+ *
150
+ * @example Create a bouncing ball
151
+ * ```ts
152
+ * const sphere = ball.addComponent(SphereCollider);
153
+ * sphere.radius = 0.5;
154
+ * const rb = ball.addComponent(Rigidbody);
155
+ * rb.mass = 1;
156
+ * ```
157
+ *
122
158
  * - Example: https://samples.needle.tools/physics-basic
123
- * - Example: https://samples.needle.tools/physics-playground
124
- * - Example: https://samples.needle.tools/physics-&-animation
125
- *
159
+ *
160
+ * @summary Sphere-shaped physics collider
126
161
  * @category Physics
127
162
  * @group Components
163
+ * @see {@link Collider} for base collider functionality
164
+ * @see {@link CapsuleCollider} for elongated sphere shapes
128
165
  */
129
166
  export class SphereCollider extends Collider implements ISphereCollider {
130
167
 
@@ -167,15 +204,31 @@ export class SphereCollider extends Collider implements ISphereCollider {
167
204
  }
168
205
 
169
206
  /**
170
- * BoxCollider represents a box-shaped collision volume.
171
- * Ideal for rectangular objects or objects that need a simple cuboid collision boundary.
207
+ * BoxCollider represents a box-shaped (cuboid) collision volume.
208
+ * Most common collider type, efficient for walls, floors, crates, and rectangular objects.
172
209
  *
210
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
211
+ *
212
+ * @example Create a floor collider
213
+ * ```ts
214
+ * const box = floor.addComponent(BoxCollider);
215
+ * box.size = new Vector3(10, 0.1, 10);
216
+ * box.center = new Vector3(0, -0.05, 0);
217
+ * ```
218
+ *
219
+ * @example Auto-fit to mesh geometry
220
+ * ```ts
221
+ * const collider = BoxCollider.add(myMesh, { rigidbody: true });
222
+ * // Collider size is automatically set from mesh bounds
223
+ * ```
224
+ *
173
225
  * - Example: https://samples.needle.tools/physics-basic
174
- * - Example: https://samples.needle.tools/physics-playground
175
- * - Example: https://samples.needle.tools/physics-&-animation
176
- *
226
+ *
227
+ * @summary Box-shaped physics collider
177
228
  * @category Physics
178
229
  * @group Components
230
+ * @see {@link Collider} for base collider functionality
231
+ * @see {@link SphereCollider} for sphere shapes
179
232
  */
180
233
  export class BoxCollider extends Collider implements IBoxCollider {
181
234
 
@@ -274,8 +327,10 @@ export class BoxCollider extends Collider implements IBoxCollider {
274
327
  }
275
328
 
276
329
  /**
277
- * MeshCollider creates a collision shape from a mesh geometry.
278
- * Allows for complex collision shapes that match the exact geometry of an object.
330
+ * MeshCollider creates a collision shape from a mesh geometry.
331
+ * Allows for complex collision shapes that match the exact geometry of an object.
332
+ *
333
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
279
334
  *
280
335
  * - Example: https://samples.needle.tools/physics-basic
281
336
  * - Example: https://samples.needle.tools/physics-playground
@@ -362,8 +417,10 @@ export class MeshCollider extends Collider {
362
417
  }
363
418
 
364
419
  /**
365
- * CapsuleCollider represents a capsule-shaped collision volume (cylinder with hemispherical ends).
366
- * Ideal for character controllers and objects that need a rounded collision shape.
420
+ * CapsuleCollider represents a capsule-shaped collision volume (cylinder with hemispherical ends).
421
+ * Ideal for character controllers and objects that need a rounded collision shape.
422
+ *
423
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
367
424
  *
368
425
  * - Example: https://samples.needle.tools/physics-basic
369
426
  * - Example: https://samples.needle.tools/physics-playground
@@ -13,6 +13,9 @@ import { HideFlags, IGameObject, Vec3 } from "../engine/engine_types.js";
13
13
  import { getParam } from "../engine/engine_utils.js"
14
14
  import { setCustomVisibility } from "../engine/js-extensions/Layers.js";
15
15
  import { Behaviour, GameObject } from "./Component.js";
16
+ import type { Light } from "./Light.js";
17
+ import type { Renderer } from "./Renderer.js";
18
+ import type { ShadowCatcher } from "./ShadowCatcher.js";
16
19
 
17
20
  const debug = getParam("debugcontactshadows");
18
21
 
@@ -44,19 +47,40 @@ type FitParameters = {
44
47
  // - node can simply be scaled in Y to adjust max. ground height
45
48
 
46
49
  /**
47
- * ContactShadows is a component that allows to display contact shadows in the scene. It has options for darkness, opacity and blur of the shadows.
48
- *
49
- * - Example: https://samples.needle.tools/contact-shadows
50
- *
51
- * ## Usage
52
- * You can use {@link ContactShadows.auto} to automatically create a ContactShadows instance for the scene or you can add the component to an object in the scene. Note that the scale of the object will be used to define the size of the shadow area.
53
- *
54
- * ContactShadows can also be enabled on the `<needle-engine>` web component directly by adding the `contactshadows` attribute. The value of the attribute will be used as opacity and darkness of the shadows: `<needle-engine contactshadows="0.7">`.
50
+ * [ContactShadows](https://engine.needle.tools/docs/api/ContactShadows) renders proximity-based soft shadows on flat surfaces.
51
+ * Ideal for products or objects that need visual grounding without real-time shadows.
52
+ * Produces soft, blurred shadows that hug the ground, giving a sense of contact and depth.
55
53
  *
54
+ * ![](https://cloud.needle.tools/-/media/87bPTNXHcsbV-An-oSEvHQ.gif)
55
+ *
56
+ * **Setup options:**
57
+ * 1. `ContactShadows.auto(context)` - Auto-create and fit to scene
58
+ * 2. Add component manually to control position and scale
59
+ * 3. HTML attribute: `<needle-engine contactshadows="0.7">`
60
+ *
61
+ * **Properties:**
62
+ * - `opacity` / `darkness` - Shadow intensity
63
+ * - `blur` - Softness of shadow edges
64
+ * - Object scale defines shadow area size
65
+ *
66
+ * **Debug:** Use `?debugcontactshadows` URL parameter.
67
+ *
68
+ *
69
+ * @example Auto-create contact shadows
70
+ * ```ts
71
+ * const shadows = ContactShadows.auto(this.context);
72
+ * shadows.opacity = 0.5;
73
+ * shadows.darkness = 0.8;
74
+ * ```
75
+ *
56
76
  * @summary Display contact shadows on the ground
57
77
  * @category Rendering
58
78
  * @group Components
59
- */
79
+ * @see {@link ShadowCatcher} for real-time shadows from lights (more accurate, higher performance cost)
80
+ * @see {@link Light} for real-time shadow casting
81
+ * @see {@link Renderer} for material/rendering control
82
+ * @link https://engine.needle.tools/samples/contact-shadows for a demo of contact shadows
83
+ */
60
84
  export class ContactShadows extends Behaviour {
61
85
 
62
86
  private static readonly _instances: Map<Context, ContactShadows> = new Map();
@@ -161,6 +185,7 @@ export class ContactShadows extends Behaviour {
161
185
  private occluderMesh?: Mesh;
162
186
  private blurPlane?: Mesh;
163
187
 
188
+ private planeMaterial?: MeshBasicMaterial;
164
189
  private depthMaterial?: MeshDepthMaterial;
165
190
  private horizontalBlurMaterial?: ShaderMaterial;
166
191
  private verticalBlurMaterial?: ShaderMaterial;
@@ -258,7 +283,7 @@ export class ContactShadows extends Behaviour {
258
283
  // mat.depthWrite = false;
259
284
  }
260
285
 
261
- const planeMaterial = new MeshBasicMaterial({
286
+ const planeMaterial = this.planeMaterial = new MeshBasicMaterial({
262
287
  map: this.renderTarget.texture,
263
288
  opacity: this.opacity,
264
289
  color: 0x000000,
@@ -376,11 +401,16 @@ export class ContactShadows extends Behaviour {
376
401
  if (!this.renderTarget || !this.renderTargetBlur ||
377
402
  !this.depthMaterial || !this.shadowCamera ||
378
403
  !this.blurPlane || !this.shadowGroup || !this.plane ||
379
- !this.horizontalBlurMaterial || !this.verticalBlurMaterial) {
404
+ !this.horizontalBlurMaterial || !this.verticalBlurMaterial || !this.planeMaterial) {
380
405
  if (debug) console.error("ContactShadows: not initialized yet");
381
406
  return;
382
407
  }
383
408
 
409
+ // Update properties that might have been changed
410
+ this.depthMaterial.userData.darkness.value = this.darkness;
411
+ this.planeMaterial.opacity = this.opacity;
412
+
413
+
384
414
  const scene = this.context.scene;
385
415
  const renderer = this.context.renderer;
386
416
  const initialRenderTarget = renderer.getRenderTarget();
@@ -10,11 +10,37 @@ import { UsageMarker } from "./Interactable.js";
10
10
 
11
11
  const debug = getParam("debugdeletable");
12
12
  /**
13
- * A box-shaped area that can be used to delete objects that get into it. Useful for sandbox-style builders or physics simulations.
13
+ * The [DeleteBox](https://engine.needle.tools/docs/api/DeleteBox) component creates an invisible deletion zone that destroys objects entering it.
14
+ * Works with objects that have a {@link Deletable} component attached.
14
15
  *
16
+ * ![](https://cloud.needle.tools/-/media/J-Gmdhl214kfdjkfYViG8g.gif)
17
+ *
18
+ * **Use cases:**
19
+ * - Trash bins in sandbox builders
20
+ * - Kill zones in physics simulations
21
+ * - Cleanup areas for multiplayer scenes
22
+ *
23
+ * **Setup:**
24
+ * 1. Add DeleteBox to a GameObject with a BoxCollider-like shape
25
+ * 2. Add {@link Deletable} component to objects that should be destroyable
26
+ * 3. Objects entering the box will be destroyed (synced across network)
27
+ *
28
+ * **Debug:** Use `?debugdeletable` URL parameter to visualize deletion areas.
29
+ *
30
+ * - Example: https://engine.needle.tools/samples/collaborative-sandbox
31
+ *
32
+ * @example Create a deletion zone
33
+ * ```ts
34
+ * const trashBin = trashBinModel.addComponent(DeleteBox);
35
+ * // Objects with Deletable component will be destroyed when entering
36
+ * ```
37
+ *
15
38
  * @summary Box area that deletes objects entering it
16
39
  * @category Interactivity
17
40
  * @group Components
41
+ * @see {@link Deletable} - Add to objects that can be destroyed
42
+ * @see {@link Duplicatable} for spawning objects
43
+ * @see {@link DragControls} for moving objects
18
44
  */
19
45
  export class DeleteBox extends BoxHelperComponent {
20
46
  static _instances: DeleteBox[] = [];
@@ -29,9 +55,24 @@ export class DeleteBox extends BoxHelperComponent {
29
55
  }
30
56
  }
31
57
 
32
- /** Objects with this component can be destroyed by the {@link DeleteBox} component.
58
+ /**
59
+ * Marks a GameObject as deletable by {@link DeleteBox} zones.
60
+ * Objects with this component will be destroyed (and synced across network)
61
+ * when they enter a DeleteBox area.
62
+ *
63
+ * **Note:** Objects currently being used (with {@link UsageMarker}) are protected from deletion.
64
+ *
65
+ * @example Make an object deletable
66
+ * ```ts
67
+ * const deletable = spawnedObject.addComponent(Deletable);
68
+ * // Object can now be destroyed by entering a DeleteBox
69
+ * ```
70
+ *
71
+ * @summary Marks object as destroyable by DeleteBox
33
72
  * @category Interactivity
34
73
  * @group Components
74
+ * @see {@link DeleteBox} for the deletion trigger
75
+ * @see {@link UsageMarker} for protecting objects in use
35
76
  */
36
77
  export class Deletable extends Behaviour {
37
78
 
@@ -11,12 +11,31 @@ export enum DeviceType {
11
11
  }
12
12
 
13
13
  /**
14
- * Enables or disables the GameObject based on the device type (mobile or desktop).
15
- * You can use this to show or hide objects depending on whether the user is on a mobile device or a desktop.
16
- *
14
+ * DeviceFlag shows or hides GameObjects based on device type.
15
+ * Use for responsive 3D content - show different UI, models, or interactions
16
+ * depending on mobile vs desktop.
17
+ *
18
+ * **Device types:**
19
+ * - `Desktop` - Traditional computers with mouse/keyboard
20
+ * - `Mobile` - Phones and tablets with touch input
21
+ * - Combine with bitwise OR for multiple: `Desktop | Mobile`
22
+ *
23
+ * @example Show only on desktop
24
+ * ```ts
25
+ * const flag = myObject.addComponent(DeviceFlag);
26
+ * flag.visibleOn = DeviceType.Desktop;
27
+ * ```
28
+ *
29
+ * @example Show on both mobile and desktop
30
+ * ```ts
31
+ * flag.visibleOn = DeviceType.Desktop | DeviceType.Mobile;
32
+ * ```
33
+ *
17
34
  * @summary Show or hide GameObject based on device type
18
35
  * @category Utilities
19
36
  * @group Components
37
+ * @see {@link DeviceType} for device options
38
+ * @see {@link XRFlag} for XR-based visibility
20
39
  */
21
40
  export class DeviceFlag extends Behaviour {
22
41
 
@@ -43,12 +43,42 @@ export enum DragMode {
43
43
  }
44
44
 
45
45
  /**
46
- * DragControls allows you to drag objects around in the scene. It can be used to move objects in 2D (screen space) or 3D (world space).
47
- * Debug mode can be enabled with the URL parameter `?debugdrag`, which shows visual helpers and logs drag operations.
46
+ * [DragControls](https://engine.needle.tools/docs/api/DragControls) enables interactive dragging of objects in 2D (screen space) or 3D (world space).
47
+ *
48
+ * ![](https://cloud.needle.tools/-/media/HyrtRDLjdmndr23_SR4mYw.gif)
48
49
  *
50
+ * **Drag modes:**
51
+ * - `XZPlane` - Drag on horizontal plane (good for floor objects)
52
+ * - `Attached` - Follow pointer directly (screen plane in 2D, controller in XR)
53
+ * - `HitNormal` - Drag along the surface normal where clicked
54
+ * - `DynamicViewAngle` - Auto-switch between XZ and screen based on view angle
55
+ * - `SnapToSurfaces` - Snap to scene geometry while dragging
56
+ *
57
+ * **Features:**
58
+ * - Works across desktop, mobile, VR, and AR
59
+ * - Optional grid snapping (`snapGridResolution`)
60
+ * - Rotation preservation (`keepRotation`)
61
+ * - Automatic networking with {@link SyncedTransform}
62
+ *
63
+ *
64
+ * **Debug:** Use `?debugdrag` URL parameter for visual helpers.
65
+ *
66
+ * @example Basic draggable object
67
+ * ```ts
68
+ * const drag = myObject.addComponent(DragControls);
69
+ * drag.dragMode = DragMode.XZPlane;
70
+ * drag.snapGridResolution = 0.5; // Snap to 0.5 unit grid
71
+ * ```
72
+ *
73
+ * - Example: https://engine.needle.tools/samples/collaborative-sandbox
74
+ *
49
75
  * @summary Enables dragging of objects in 2D or 3D space
50
76
  * @category Interactivity
51
77
  * @group Components
78
+ * @see {@link DragMode} for available drag behaviors
79
+ * @see {@link Duplicatable} for drag-to-duplicate functionality
80
+ * @see {@link SyncedTransform} for networked dragging
81
+ * @see {@link ObjectRaycaster} for pointer detection
52
82
  */
53
83
  export class DragControls extends Behaviour implements IPointerEventHandler {
54
84