@needle-tools/engine 4.13.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/README.md +37 -0
  3. package/components.needle.json +1 -1
  4. package/custom-elements.json +138 -4
  5. package/dist/{needle-engine.bundle-CxaKFQVS.min.js → needle-engine.bundle-BNIUpreS.min.js} +107 -107
  6. package/dist/{needle-engine.bundle-Dl3TFYyv.js → needle-engine.bundle-DauZUYl7.js} +2347 -1845
  7. package/dist/{needle-engine.bundle-J4k4znv8.umd.cjs → needle-engine.bundle-tjI5Fq2c.umd.cjs} +108 -108
  8. package/dist/needle-engine.d.ts +4022 -419
  9. package/dist/needle-engine.js +2 -2
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/lib/engine/engine_context.d.ts +16 -0
  13. package/lib/engine/engine_context.js +16 -0
  14. package/lib/engine/engine_context.js.map +1 -1
  15. package/lib/engine/engine_gameobject.d.ts +72 -0
  16. package/lib/engine/engine_gameobject.js +38 -0
  17. package/lib/engine/engine_gameobject.js.map +1 -1
  18. package/lib/engine/engine_input.d.ts +80 -4
  19. package/lib/engine/engine_input.js +78 -2
  20. package/lib/engine/engine_input.js.map +1 -1
  21. package/lib/engine/engine_math.d.ts +81 -2
  22. package/lib/engine/engine_math.js +68 -2
  23. package/lib/engine/engine_math.js.map +1 -1
  24. package/lib/engine/engine_networking.d.ts +181 -14
  25. package/lib/engine/engine_networking.js +181 -14
  26. package/lib/engine/engine_networking.js.map +1 -1
  27. package/lib/engine/engine_networking_auto.d.ts +35 -8
  28. package/lib/engine/engine_networking_auto.js +35 -8
  29. package/lib/engine/engine_networking_auto.js.map +1 -1
  30. package/lib/engine/engine_physics.d.ts +37 -1
  31. package/lib/engine/engine_physics.js +37 -1
  32. package/lib/engine/engine_physics.js.map +1 -1
  33. package/lib/engine/engine_physics_rapier.d.ts +78 -0
  34. package/lib/engine/engine_physics_rapier.js +78 -0
  35. package/lib/engine/engine_physics_rapier.js.map +1 -1
  36. package/lib/engine/engine_serialization_decorator.d.ts +28 -2
  37. package/lib/engine/engine_serialization_decorator.js +28 -2
  38. package/lib/engine/engine_serialization_decorator.js.map +1 -1
  39. package/lib/engine/engine_time.d.ts +23 -3
  40. package/lib/engine/engine_time.js +23 -3
  41. package/lib/engine/engine_time.js.map +1 -1
  42. package/lib/engine/engine_util_decorator.d.ts +31 -1
  43. package/lib/engine/engine_util_decorator.js +31 -1
  44. package/lib/engine/engine_util_decorator.js.map +1 -1
  45. package/lib/engine/engine_utils.d.ts +21 -5
  46. package/lib/engine/engine_utils.js +21 -5
  47. package/lib/engine/engine_utils.js.map +1 -1
  48. package/lib/engine/extensions/NEEDLE_materialx.d.ts +2 -2
  49. package/lib/engine/extensions/NEEDLE_materialx.js +2 -2
  50. package/lib/engine/extensions/NEEDLE_materialx.js.map +1 -1
  51. package/lib/engine/extensions/index.d.ts +1 -1
  52. package/lib/engine/extensions/index.js +1 -1
  53. package/lib/engine/extensions/index.js.map +1 -1
  54. package/lib/engine-components/AlignmentConstraint.d.ts +23 -3
  55. package/lib/engine-components/AlignmentConstraint.js +23 -3
  56. package/lib/engine-components/AlignmentConstraint.js.map +1 -1
  57. package/lib/engine-components/Animation.d.ts +42 -0
  58. package/lib/engine-components/Animation.js +36 -0
  59. package/lib/engine-components/Animation.js.map +1 -1
  60. package/lib/engine-components/Animator.d.ts +37 -4
  61. package/lib/engine-components/Animator.js +37 -4
  62. package/lib/engine-components/Animator.js.map +1 -1
  63. package/lib/engine-components/AudioListener.d.ts +1 -1
  64. package/lib/engine-components/AudioListener.js +1 -1
  65. package/lib/engine-components/AudioSource.d.ts +32 -10
  66. package/lib/engine-components/AudioSource.js +32 -10
  67. package/lib/engine-components/AudioSource.js.map +1 -1
  68. package/lib/engine-components/AxesHelper.d.ts +22 -3
  69. package/lib/engine-components/AxesHelper.js +22 -3
  70. package/lib/engine-components/AxesHelper.js.map +1 -1
  71. package/lib/engine-components/BasicIKConstraint.d.ts +27 -4
  72. package/lib/engine-components/BasicIKConstraint.js +27 -4
  73. package/lib/engine-components/BasicIKConstraint.js.map +1 -1
  74. package/lib/engine-components/Camera.d.ts +32 -2
  75. package/lib/engine-components/Camera.js +32 -2
  76. package/lib/engine-components/Camera.js.map +1 -1
  77. package/lib/engine-components/CharacterController.d.ts +68 -4
  78. package/lib/engine-components/CharacterController.js +68 -4
  79. package/lib/engine-components/CharacterController.js.map +1 -1
  80. package/lib/engine-components/Collider.d.ts +69 -12
  81. package/lib/engine-components/Collider.js +69 -12
  82. package/lib/engine-components/Collider.js.map +1 -1
  83. package/lib/engine-components/ContactShadows.d.ts +28 -6
  84. package/lib/engine-components/ContactShadows.js +33 -8
  85. package/lib/engine-components/ContactShadows.js.map +1 -1
  86. package/lib/engine-components/DeleteBox.d.ts +43 -2
  87. package/lib/engine-components/DeleteBox.js +43 -2
  88. package/lib/engine-components/DeleteBox.js.map +1 -1
  89. package/lib/engine-components/DeviceFlag.d.ts +21 -2
  90. package/lib/engine-components/DeviceFlag.js +21 -2
  91. package/lib/engine-components/DeviceFlag.js.map +1 -1
  92. package/lib/engine-components/DragControls.d.ts +32 -2
  93. package/lib/engine-components/DragControls.js +32 -2
  94. package/lib/engine-components/DragControls.js.map +1 -1
  95. package/lib/engine-components/DropListener.d.ts +33 -21
  96. package/lib/engine-components/DropListener.js +33 -21
  97. package/lib/engine-components/DropListener.js.map +1 -1
  98. package/lib/engine-components/Duplicatable.d.ts +36 -5
  99. package/lib/engine-components/Duplicatable.js +36 -5
  100. package/lib/engine-components/Duplicatable.js.map +1 -1
  101. package/lib/engine-components/EventList.d.ts +38 -10
  102. package/lib/engine-components/EventList.js +40 -12
  103. package/lib/engine-components/EventList.js.map +1 -1
  104. package/lib/engine-components/EventTrigger.d.ts +1 -1
  105. package/lib/engine-components/EventTrigger.js +1 -1
  106. package/lib/engine-components/Fog.d.ts +23 -1
  107. package/lib/engine-components/Fog.js +23 -1
  108. package/lib/engine-components/Fog.js.map +1 -1
  109. package/lib/engine-components/GridHelper.d.ts +18 -2
  110. package/lib/engine-components/GridHelper.js +18 -2
  111. package/lib/engine-components/GridHelper.js.map +1 -1
  112. package/lib/engine-components/GroundProjection.d.ts +24 -2
  113. package/lib/engine-components/GroundProjection.js +24 -2
  114. package/lib/engine-components/GroundProjection.js.map +1 -1
  115. package/lib/engine-components/Interactable.d.ts +17 -2
  116. package/lib/engine-components/Interactable.js +17 -2
  117. package/lib/engine-components/Interactable.js.map +1 -1
  118. package/lib/engine-components/Joints.d.ts +50 -7
  119. package/lib/engine-components/Joints.js +50 -7
  120. package/lib/engine-components/Joints.js.map +1 -1
  121. package/lib/engine-components/LODGroup.d.ts +36 -14
  122. package/lib/engine-components/LODGroup.js +43 -11
  123. package/lib/engine-components/LODGroup.js.map +1 -1
  124. package/lib/engine-components/Light.d.ts +30 -5
  125. package/lib/engine-components/Light.js +30 -5
  126. package/lib/engine-components/Light.js.map +1 -1
  127. package/lib/engine-components/LookAtConstraint.d.ts +22 -7
  128. package/lib/engine-components/LookAtConstraint.js +22 -7
  129. package/lib/engine-components/LookAtConstraint.js.map +1 -1
  130. package/lib/engine-components/NeedleMenu.d.ts +27 -5
  131. package/lib/engine-components/NeedleMenu.js +27 -5
  132. package/lib/engine-components/NeedleMenu.js.map +1 -1
  133. package/lib/engine-components/NestedGltf.d.ts +39 -4
  134. package/lib/engine-components/NestedGltf.js +42 -4
  135. package/lib/engine-components/NestedGltf.js.map +1 -1
  136. package/lib/engine-components/OffsetConstraint.d.ts +27 -3
  137. package/lib/engine-components/OffsetConstraint.js +27 -3
  138. package/lib/engine-components/OffsetConstraint.js.map +1 -1
  139. package/lib/engine-components/OrbitControls.d.ts +41 -3
  140. package/lib/engine-components/OrbitControls.js +41 -3
  141. package/lib/engine-components/OrbitControls.js.map +1 -1
  142. package/lib/engine-components/PlayerColor.d.ts +1 -1
  143. package/lib/engine-components/PlayerColor.js +1 -1
  144. package/lib/engine-components/ReflectionProbe.d.ts +17 -2
  145. package/lib/engine-components/ReflectionProbe.js +17 -3
  146. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  147. package/lib/engine-components/Renderer.d.ts +35 -0
  148. package/lib/engine-components/Renderer.js +36 -2
  149. package/lib/engine-components/Renderer.js.map +1 -1
  150. package/lib/engine-components/RigidBody.d.ts +57 -5
  151. package/lib/engine-components/RigidBody.js +57 -5
  152. package/lib/engine-components/RigidBody.js.map +1 -1
  153. package/lib/engine-components/SceneSwitcher.d.ts +11 -0
  154. package/lib/engine-components/SceneSwitcher.js +11 -0
  155. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  156. package/lib/engine-components/ScreenCapture.d.ts +39 -6
  157. package/lib/engine-components/ScreenCapture.js +39 -6
  158. package/lib/engine-components/ScreenCapture.js.map +1 -1
  159. package/lib/engine-components/SeeThrough.d.ts +70 -5
  160. package/lib/engine-components/SeeThrough.js +70 -5
  161. package/lib/engine-components/SeeThrough.js.map +1 -1
  162. package/lib/engine-components/ShadowCatcher.d.ts +56 -4
  163. package/lib/engine-components/ShadowCatcher.js +56 -4
  164. package/lib/engine-components/ShadowCatcher.js.map +1 -1
  165. package/lib/engine-components/Skybox.d.ts +43 -7
  166. package/lib/engine-components/Skybox.js +43 -7
  167. package/lib/engine-components/Skybox.js.map +1 -1
  168. package/lib/engine-components/SmoothFollow.d.ts +66 -7
  169. package/lib/engine-components/SmoothFollow.js +66 -7
  170. package/lib/engine-components/SmoothFollow.js.map +1 -1
  171. package/lib/engine-components/SpatialTrigger.d.ts +48 -1
  172. package/lib/engine-components/SpatialTrigger.js +48 -1
  173. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  174. package/lib/engine-components/SpectatorCamera.d.ts +21 -3
  175. package/lib/engine-components/SpectatorCamera.js +21 -3
  176. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  177. package/lib/engine-components/SyncedRoom.d.ts +7 -1
  178. package/lib/engine-components/SyncedRoom.js +7 -1
  179. package/lib/engine-components/SyncedRoom.js.map +1 -1
  180. package/lib/engine-components/SyncedTransform.d.ts +55 -6
  181. package/lib/engine-components/SyncedTransform.js +55 -6
  182. package/lib/engine-components/SyncedTransform.js.map +1 -1
  183. package/lib/engine-components/TransformGizmo.d.ts +30 -3
  184. package/lib/engine-components/TransformGizmo.js +30 -3
  185. package/lib/engine-components/TransformGizmo.js.map +1 -1
  186. package/lib/engine-components/VideoPlayer.d.ts +33 -6
  187. package/lib/engine-components/VideoPlayer.js +45 -6
  188. package/lib/engine-components/VideoPlayer.js.map +1 -1
  189. package/lib/engine-components/Voip.d.ts +33 -2
  190. package/lib/engine-components/Voip.js +33 -2
  191. package/lib/engine-components/Voip.js.map +1 -1
  192. package/lib/engine-components/export/usdz/USDZExporter.d.ts +47 -13
  193. package/lib/engine-components/export/usdz/USDZExporter.js +47 -13
  194. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  195. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +82 -3
  196. package/lib/engine-components/particlesystem/ParticleSystem.js +82 -3
  197. package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
  198. package/lib/engine-components/postprocessing/Effects/Antialiasing.d.ts +1 -0
  199. package/lib/engine-components/postprocessing/Effects/Antialiasing.js +1 -0
  200. package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
  201. package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -1
  202. package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -1
  203. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +1 -1
  204. package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +1 -1
  205. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +1 -1
  206. package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +1 -1
  207. package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +1 -1
  208. package/lib/engine-components/postprocessing/Effects/DepthOfField.js +1 -1
  209. package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
  210. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
  211. package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
  212. package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +1 -1
  213. package/lib/engine-components/postprocessing/Effects/Pixelation.js +1 -1
  214. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.d.ts +1 -1
  215. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +1 -1
  216. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +1 -1
  217. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +1 -1
  218. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +1 -1
  219. package/lib/engine-components/postprocessing/Effects/Sharpening.js +1 -1
  220. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +1 -1
  221. package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +1 -1
  222. package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +1 -1
  223. package/lib/engine-components/postprocessing/Effects/Tonemapping.js +1 -1
  224. package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +1 -1
  225. package/lib/engine-components/postprocessing/Effects/Vignette.js +1 -1
  226. package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +1 -1
  227. package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
  228. package/lib/engine-components/postprocessing/Volume.d.ts +1 -1
  229. package/lib/engine-components/postprocessing/Volume.js +1 -1
  230. package/lib/engine-components/splines/Spline.d.ts +409 -12
  231. package/lib/engine-components/splines/Spline.js +409 -12
  232. package/lib/engine-components/splines/Spline.js.map +1 -1
  233. package/lib/engine-components/splines/SplineUtils.d.ts +1 -0
  234. package/lib/engine-components/splines/SplineUtils.js +1 -0
  235. package/lib/engine-components/splines/SplineUtils.js.map +1 -1
  236. package/lib/engine-components/splines/SplineWalker.d.ts +3 -1
  237. package/lib/engine-components/splines/SplineWalker.js +3 -1
  238. package/lib/engine-components/splines/SplineWalker.js.map +1 -1
  239. package/lib/engine-components/timeline/PlayableDirector.d.ts +103 -14
  240. package/lib/engine-components/timeline/PlayableDirector.js +95 -25
  241. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  242. package/lib/engine-components/timeline/TimelineModels.d.ts +14 -0
  243. package/lib/engine-components/timeline/TimelineModels.js +4 -0
  244. package/lib/engine-components/timeline/TimelineModels.js.map +1 -1
  245. package/lib/engine-components/ui/Button.d.ts +29 -3
  246. package/lib/engine-components/ui/Button.js +29 -3
  247. package/lib/engine-components/ui/Button.js.map +1 -1
  248. package/lib/engine-components/ui/Canvas.d.ts +29 -4
  249. package/lib/engine-components/ui/Canvas.js +29 -4
  250. package/lib/engine-components/ui/Canvas.js.map +1 -1
  251. package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
  252. package/lib/engine-components/ui/CanvasGroup.js +1 -1
  253. package/lib/engine-components/ui/EventSystem.d.ts +1 -1
  254. package/lib/engine-components/ui/EventSystem.js +1 -1
  255. package/lib/engine-components/ui/Graphic.d.ts +1 -0
  256. package/lib/engine-components/ui/Graphic.js +1 -0
  257. package/lib/engine-components/ui/Graphic.js.map +1 -1
  258. package/lib/engine-components/ui/Image.d.ts +22 -3
  259. package/lib/engine-components/ui/Image.js +22 -3
  260. package/lib/engine-components/ui/Image.js.map +1 -1
  261. package/lib/engine-components/ui/InputField.d.ts +1 -1
  262. package/lib/engine-components/ui/InputField.js +1 -1
  263. package/lib/engine-components/ui/Layout.d.ts +3 -0
  264. package/lib/engine-components/ui/Layout.js +3 -0
  265. package/lib/engine-components/ui/Layout.js.map +1 -1
  266. package/lib/engine-components/ui/Outline.d.ts +1 -1
  267. package/lib/engine-components/ui/Outline.js +1 -1
  268. package/lib/engine-components/ui/PointerEvents.d.ts +1 -1
  269. package/lib/engine-components/ui/PointerEvents.js +1 -1
  270. package/lib/engine-components/ui/Raycaster.d.ts +55 -6
  271. package/lib/engine-components/ui/Raycaster.js +55 -6
  272. package/lib/engine-components/ui/Raycaster.js.map +1 -1
  273. package/lib/engine-components/ui/RectTransform.d.ts +1 -1
  274. package/lib/engine-components/ui/RectTransform.js +1 -1
  275. package/lib/engine-components/ui/SpatialHtml.d.ts +1 -1
  276. package/lib/engine-components/ui/SpatialHtml.js +1 -1
  277. package/lib/engine-components/ui/Text.d.ts +23 -1
  278. package/lib/engine-components/ui/Text.js +23 -1
  279. package/lib/engine-components/ui/Text.js.map +1 -1
  280. package/lib/engine-components/utils/LookAt.d.ts +1 -1
  281. package/lib/engine-components/utils/LookAt.js +1 -1
  282. package/lib/engine-components/utils/OpenURL.d.ts +1 -1
  283. package/lib/engine-components/utils/OpenURL.js +1 -1
  284. package/lib/engine-components/web/Clickthrough.d.ts +116 -7
  285. package/lib/engine-components/web/Clickthrough.js +116 -7
  286. package/lib/engine-components/web/Clickthrough.js.map +1 -1
  287. package/lib/engine-components/web/CursorFollow.d.ts +171 -7
  288. package/lib/engine-components/web/CursorFollow.js +171 -7
  289. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  290. package/lib/engine-components/web/HoverAnimation.d.ts +140 -11
  291. package/lib/engine-components/web/HoverAnimation.js +140 -11
  292. package/lib/engine-components/web/HoverAnimation.js.map +1 -1
  293. package/lib/engine-components/web/ScrollFollow.d.ts +4 -1
  294. package/lib/engine-components/web/ScrollFollow.js +4 -1
  295. package/lib/engine-components/web/ScrollFollow.js.map +1 -1
  296. package/lib/engine-components/web/ViewBox.d.ts +116 -16
  297. package/lib/engine-components/web/ViewBox.js +110 -16
  298. package/lib/engine-components/web/ViewBox.js.map +1 -1
  299. package/lib/engine-components/webxr/TeleportTarget.d.ts +21 -2
  300. package/lib/engine-components/webxr/TeleportTarget.js +21 -2
  301. package/lib/engine-components/webxr/TeleportTarget.js.map +1 -1
  302. package/lib/engine-components/webxr/WebXR.d.ts +10 -2
  303. package/lib/engine-components/webxr/WebXR.js +10 -2
  304. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  305. package/lib/engine-components/webxr/WebXRAvatar.d.ts +39 -2
  306. package/lib/engine-components/webxr/WebXRAvatar.js +35 -3
  307. package/lib/engine-components/webxr/WebXRAvatar.js.map +1 -1
  308. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +266 -30
  309. package/lib/engine-components/webxr/WebXRImageTracking.js +266 -30
  310. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  311. package/lib/engine-components/webxr/WebXRPlaneTracking.d.ts +1 -1
  312. package/lib/engine-components/webxr/WebXRPlaneTracking.js +1 -1
  313. package/lib/engine-components/webxr/XRFlag.d.ts +29 -2
  314. package/lib/engine-components/webxr/XRFlag.js +29 -2
  315. package/lib/engine-components/webxr/XRFlag.js.map +1 -1
  316. package/package.json +1 -1
  317. package/plugins/vite/custom-element-data.js +128 -19
  318. package/src/engine/engine_context.ts +16 -0
  319. package/src/engine/engine_gameobject.ts +73 -0
  320. package/src/engine/engine_input.ts +83 -7
  321. package/src/engine/engine_math.ts +81 -2
  322. package/src/engine/engine_networking.ts +186 -17
  323. package/src/engine/engine_networking_auto.ts +36 -9
  324. package/src/engine/engine_physics.ts +41 -1
  325. package/src/engine/engine_physics_rapier.ts +81 -0
  326. package/src/engine/engine_serialization_decorator.ts +28 -2
  327. package/src/engine/engine_time.ts +23 -3
  328. package/src/engine/engine_util_decorator.ts +31 -1
  329. package/src/engine/engine_utils.ts +21 -5
  330. package/src/engine/extensions/NEEDLE_materialx.ts +5 -4
  331. package/src/engine/extensions/index.ts +2 -2
  332. package/src/engine-components/AlignmentConstraint.ts +24 -4
  333. package/src/engine-components/Animation.ts +44 -2
  334. package/src/engine-components/Animator.ts +40 -7
  335. package/src/engine-components/AudioListener.ts +1 -1
  336. package/src/engine-components/AudioSource.ts +37 -15
  337. package/src/engine-components/AxesHelper.ts +23 -4
  338. package/src/engine-components/BasicIKConstraint.ts +28 -5
  339. package/src/engine-components/Camera.ts +33 -3
  340. package/src/engine-components/CharacterController.ts +74 -7
  341. package/src/engine-components/Collider.ts +78 -21
  342. package/src/engine-components/ContactShadows.ts +41 -11
  343. package/src/engine-components/DeleteBox.ts +43 -2
  344. package/src/engine-components/DeviceFlag.ts +22 -3
  345. package/src/engine-components/DragControls.ts +32 -2
  346. package/src/engine-components/DropListener.ts +41 -29
  347. package/src/engine-components/Duplicatable.ts +37 -6
  348. package/src/engine-components/EventList.ts +43 -15
  349. package/src/engine-components/EventTrigger.ts +1 -1
  350. package/src/engine-components/Fog.ts +23 -1
  351. package/src/engine-components/GridHelper.ts +18 -2
  352. package/src/engine-components/GroundProjection.ts +25 -3
  353. package/src/engine-components/Interactable.ts +17 -2
  354. package/src/engine-components/Joints.ts +51 -8
  355. package/src/engine-components/LODGroup.ts +45 -11
  356. package/src/engine-components/Light.ts +35 -13
  357. package/src/engine-components/LookAtConstraint.ts +26 -8
  358. package/src/engine-components/NeedleMenu.ts +29 -7
  359. package/src/engine-components/NestedGltf.ts +40 -4
  360. package/src/engine-components/OffsetConstraint.ts +27 -3
  361. package/src/engine-components/OrbitControls.ts +41 -3
  362. package/src/engine-components/PlayerColor.ts +1 -1
  363. package/src/engine-components/ReflectionProbe.ts +19 -5
  364. package/src/engine-components/Renderer.ts +35 -1
  365. package/src/engine-components/RigidBody.ts +64 -8
  366. package/src/engine-components/SceneSwitcher.ts +11 -0
  367. package/src/engine-components/ScreenCapture.ts +42 -9
  368. package/src/engine-components/SeeThrough.ts +76 -9
  369. package/src/engine-components/ShadowCatcher.ts +61 -6
  370. package/src/engine-components/Skybox.ts +48 -12
  371. package/src/engine-components/SmoothFollow.ts +68 -7
  372. package/src/engine-components/SpatialTrigger.ts +51 -4
  373. package/src/engine-components/SpectatorCamera.ts +23 -5
  374. package/src/engine-components/SyncedRoom.ts +8 -2
  375. package/src/engine-components/SyncedTransform.ts +59 -10
  376. package/src/engine-components/TransformGizmo.ts +31 -4
  377. package/src/engine-components/VideoPlayer.ts +48 -6
  378. package/src/engine-components/Voip.ts +33 -2
  379. package/src/engine-components/export/usdz/USDZExporter.ts +47 -13
  380. package/src/engine-components/particlesystem/ParticleSystem.ts +84 -5
  381. package/src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -0
  382. package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -1
  383. package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +1 -1
  384. package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +1 -1
  385. package/src/engine-components/postprocessing/Effects/DepthOfField.ts +1 -1
  386. package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
  387. package/src/engine-components/postprocessing/Effects/Pixelation.ts +1 -1
  388. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +1 -1
  389. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +1 -1
  390. package/src/engine-components/postprocessing/Effects/Sharpening.ts +1 -1
  391. package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +1 -1
  392. package/src/engine-components/postprocessing/Effects/Tonemapping.ts +1 -1
  393. package/src/engine-components/postprocessing/Effects/Vignette.ts +1 -1
  394. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
  395. package/src/engine-components/postprocessing/Volume.ts +1 -1
  396. package/src/engine-components/splines/Spline.ts +412 -14
  397. package/src/engine-components/splines/SplineUtils.ts +1 -0
  398. package/src/engine-components/splines/SplineWalker.ts +4 -2
  399. package/src/engine-components/timeline/PlayableDirector.ts +108 -27
  400. package/src/engine-components/timeline/SignalAsset.ts +1 -1
  401. package/src/engine-components/timeline/TimelineModels.ts +18 -2
  402. package/src/engine-components/ui/Button.ts +29 -3
  403. package/src/engine-components/ui/Canvas.ts +29 -4
  404. package/src/engine-components/ui/CanvasGroup.ts +2 -2
  405. package/src/engine-components/ui/EventSystem.ts +1 -1
  406. package/src/engine-components/ui/Graphic.ts +1 -0
  407. package/src/engine-components/ui/Image.ts +22 -3
  408. package/src/engine-components/ui/InputField.ts +2 -2
  409. package/src/engine-components/ui/Layout.ts +3 -0
  410. package/src/engine-components/ui/Outline.ts +1 -1
  411. package/src/engine-components/ui/PointerEvents.ts +1 -1
  412. package/src/engine-components/ui/Raycaster.ts +57 -8
  413. package/src/engine-components/ui/RectTransform.ts +2 -2
  414. package/src/engine-components/ui/SpatialHtml.ts +1 -1
  415. package/src/engine-components/ui/Text.ts +24 -2
  416. package/src/engine-components/utils/LookAt.ts +1 -1
  417. package/src/engine-components/utils/OpenURL.ts +1 -1
  418. package/src/engine-components/web/Clickthrough.ts +119 -10
  419. package/src/engine-components/web/CursorFollow.ts +174 -9
  420. package/src/engine-components/web/HoverAnimation.ts +142 -13
  421. package/src/engine-components/web/ScrollFollow.ts +4 -1
  422. package/src/engine-components/web/ViewBox.ts +118 -18
  423. package/src/engine-components/webxr/TeleportTarget.ts +23 -4
  424. package/src/engine-components/webxr/WebXR.ts +11 -3
  425. package/src/engine-components/webxr/WebXRAvatar.ts +41 -4
  426. package/src/engine-components/webxr/WebXRImageTracking.ts +282 -38
  427. package/src/engine-components/webxr/WebXRPlaneTracking.ts +1 -1
  428. package/src/engine-components/webxr/XRFlag.ts +30 -3
@@ -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
  /**
@@ -10,6 +10,8 @@ import { Behaviour } from "./Component.js";
10
10
  import { IUSDExporterExtension } from "./export/usdz/Extension.js";
11
11
  import { USDZExporter } from "./export/usdz/USDZExporter.js";
12
12
  import { Renderer } from "./Renderer.js";
13
+ import type { Camera } from "./Camera.js";
14
+ import type { OrbitControls } from "./OrbitControls.js";
13
15
 
14
16
  const debugSeeThrough = getParam("debugseethrough");
15
17
 
@@ -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
 
@@ -4,6 +4,9 @@ import { ObjectUtils, PrimitiveType } from "../engine/engine_create_objects.js";
4
4
  import { serializable } from "../engine/engine_serialization_decorator.js";
5
5
  import { RGBAColor } from "../engine/js-extensions/index.js";
6
6
  import { Behaviour } from "./Component.js";
7
+ import type { ContactShadows } from "./ContactShadows.js";
8
+ import type { Light } from "./Light.js";
9
+ import type { Renderer } from "./Renderer.js";
7
10
 
8
11
  /**
9
12
  * The mode of the ShadowCatcher.
@@ -18,14 +21,66 @@ enum ShadowMode {
18
21
  }
19
22
 
20
23
  /**
21
- * ShadowCatcher can be added to an Object3D to make it render shadows (or light) in the scene. It can also be used to create a shadow mask, or to occlude light.
22
- * If the GameObject is a Mesh, it will apply a shadow-catching material to it - otherwise it will create a quad with the shadow-catching material.
23
- *
24
- * Note that ShadowCatcher meshes are not raycastable by default; if you want them to be raycastable, change the layers in `onEnable()`.
25
- *
26
- * @summary Creates a shadow mask or a light occluder
24
+ * ShadowCatcher renders real-time shadows cast by lights onto a mesh surface.
25
+ * Captures actual shadow data from the scene's lighting system (directional lights, point lights, spot lights).
26
+ *
27
+ * If the GameObject is a Mesh, it applies a shadow-catching material to it.
28
+ * Otherwise, it creates a quad mesh with the shadow-catching material automatically.
29
+ *
30
+ * [![](https://cloud.needle.tools/-/media/pFXPchA4vynNKOjgG_KucQ.gif)](https://engine.needle.tools/samples/shadow-catcher/)
31
+ * *Additive ShadowCatcher mode with point light shadows*
32
+ *
33
+ * [![](https://cloud.needle.tools/-/media/oIWgEU49rEA0xJ2TrbzVlg.gif)](https://engine.needle.tools/samples/transmission/)
34
+ * *ShadowCatcher with directional light shadows*
35
+ *
36
+ * **Shadow Modes:**
37
+ * - `ShadowMask` - Only renders shadows (works best with directional lights)
38
+ * - `Additive` - Renders light additively (works best with point/spot lights)
39
+ * - `Occluder` - Occludes light without rendering shadows
40
+ *
41
+ * **ShadowCatcher vs ContactShadows:**
42
+ * - **ShadowCatcher**: Real-time shadows from actual lights. Accurate directional shadows that match light sources. Requires lights with shadows enabled. Updates every frame.
43
+ * - **{@link ContactShadows}**: Proximity-based ambient occlusion-style shadows. Extremely soft and diffuse, ideal for subtle grounding. Better performance, works without lights.
44
+ *
45
+ * **When to use ShadowCatcher:**
46
+ * - You need accurate shadows that match specific light directions
47
+ * - Scene has real-time lighting with shadow-casting lights
48
+ * - Shadows need to follow light attenuation and angles
49
+ * - AR/VR scenarios where light estimation is available
50
+ * - Hard or semi-hard shadow edges are desired
51
+ *
52
+ * **When to use ContactShadows instead:**
53
+ * - You want very soft, ambient occlusion-style ground shadows
54
+ * - Performance is critical (no per-frame shadow rendering)
55
+ * - Scene doesn't have shadow-casting lights
56
+ * - Product visualization or configurators (subtle grounding effect)
57
+ * - Soft, diffuse shadows are more visually appealing than accurate ones
58
+ *
59
+ * **Note:** ShadowCatcher meshes are not raycastable by default (layer 2). Change layers in `onEnable()` if raycasting is needed.
60
+ *
61
+ * @example Basic shadow catcher plane
62
+ * ```ts
63
+ * const plane = new Object3D();
64
+ * const catcher = addComponent(plane, ShadowCatcher);
65
+ * catcher.mode = ShadowMode.ShadowMask;
66
+ * catcher.shadowColor = new RGBAColor(0, 0, 0, 0.8);
67
+ * ```
68
+ *
69
+ * @example Apply to existing mesh
70
+ * ```ts
71
+ * const mesh = this.gameObject.getComponent(Mesh);
72
+ * const catcher = addComponent(mesh, ShadowCatcher);
73
+ * // The mesh will now catch shadows from scene lights
74
+ * ```
75
+ *
76
+ * @summary Renders real-time shadows from lights onto surfaces
27
77
  * @category Rendering
28
78
  * @group Components
79
+ * @see {@link ContactShadows} for proximity-based fake shadows (better performance)
80
+ * @see {@link Light} for shadow-casting light configuration
81
+ * @see {@link Renderer} for shadow receiving settings
82
+ * @link https://engine.needle.tools/samples/shadow-catcher/
83
+ * @link https://engine.needle.tools/samples/transmission/
29
84
  */
30
85
  export class ShadowCatcher extends Behaviour {
31
86
 
@@ -114,20 +114,52 @@ ContextRegistry.registerCallback(ContextEvent.ContextCreationStart, () => {
114
114
 
115
115
 
116
116
  /**
117
- * RemoteSkybox is a component that allows you to set the skybox or environment texture of a scene from a URL, a local file or a static skybox name.
118
- * It supports .hdr, .exr, .jpg, .png files.
119
- *
117
+ * The [RemoteSkybox](https://engine.needle.tools/docs/api/RemoteSkybox) component allows you to set the skybox or environment texture of a scene from a URL, a local file or a static skybox name.
118
+ * It supports .hdr, .exr, .jpg, .png, and .ktx2 files.
119
+ *
120
+ * **HTML Attributes:**
121
+ * You can control skybox and environment from HTML using `<needle-engine>` attributes:
122
+ * - `background-image`: Sets the scene background/skybox image
123
+ * - `environment-image`: Sets the scene environment map (for reflections and lighting)
124
+ *
125
+ * These attributes accept URLs or magic skybox names (see examples below).
126
+ *
127
+ * **Magic Skybox Names:**
128
+ * Built-in optimized skyboxes hosted on Needle CDN:
129
+ * - `"studio"` - Neutral studio lighting (default)
130
+ * - `"blurred-skybox"` - Blurred environment
131
+ * - `"quicklook"` - Apple QuickLook object mode style
132
+ * - `"quicklook-ar"` - Apple QuickLook AR mode style
133
+ *
120
134
  * ### Events
121
135
  * - `dropped-unknown-url`: Emitted when a file is dropped on the scene. The event detail contains the sender, the url and a function to apply the url.
122
- *
123
- * @example adding a skybox
136
+ *
137
+ * @example Using HTML attributes
138
+ * ```html
139
+ * <needle-engine
140
+ * background-image="https://example.com/skybox.hdr"
141
+ * environment-image="studio">
142
+ * </needle-engine>
143
+ * ```
144
+ *
145
+ * @example Using magic skybox names
146
+ * ```html
147
+ * <needle-engine background-image="studio"></needle-engine>
148
+ * <needle-engine environment-image="quicklook"></needle-engine>
149
+ * ```
150
+ *
151
+ * @example Adding via code
124
152
  * ```ts
125
- * GameObject.addComponent(gameObject, Skybox, { url: "https://example.com/skybox.hdr", background: true, environment: true });
153
+ * GameObject.addComponent(gameObject, RemoteSkybox, {
154
+ * url: "https://example.com/skybox.hdr",
155
+ * background: true,
156
+ * environment: true
157
+ * });
126
158
  * ```
127
- *
128
- * @example handle custom url
159
+ *
160
+ * @example Handle custom dropped URL
129
161
  * ```ts
130
- * const skybox = GameObject.addComponent(gameObject, Skybox);
162
+ * const skybox = GameObject.addComponent(gameObject, RemoteSkybox);
131
163
  * skybox.addEventListener("dropped-unknown-url", (evt) => {
132
164
  * let url = evt.detail.url;
133
165
  * console.log("User dropped file", url);
@@ -137,15 +169,19 @@ ContextRegistry.registerCallback(ContextEvent.ContextCreationStart, () => {
137
169
  * evt.detail.apply(url);
138
170
  * });
139
171
  * ```
140
- *
141
- * @example update skybox url
172
+ *
173
+ * @example Update skybox at runtime
142
174
  * ```ts
143
175
  * skybox.setSkybox("https://example.com/skybox.hdr");
176
+ * // Or use a magic name:
177
+ * skybox.setSkybox("studio");
144
178
  * ```
145
- *
179
+ *
146
180
  * @summary Sets the skybox or environment texture of a scene
147
181
  * @category Rendering
148
182
  * @group Components
183
+ * @see {@link Camera} for clearFlags and background control
184
+ * @link https://engine.needle.tools/docs/html.html#needle-engine-element
149
185
  */
150
186
  export class RemoteSkybox extends Behaviour {
151
187