@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
@@ -20,29 +20,70 @@ const debug = getParam("debugimagetracking");
20
20
 
21
21
  // #region WebXRTrackedImage
22
22
 
23
+ /**
24
+ * Represents a tracked image detected during a WebXR session.
25
+ * Contains position, rotation, and tracking state information for a detected marker image.
26
+ *
27
+ * **Properties:**
28
+ * - Access image URL and physical dimensions
29
+ * - Get current position and rotation in world space
30
+ * - Check tracking state (tracked vs emulated)
31
+ * - Apply transform to 3D objects
32
+ *
33
+ * @summary Runtime data for a detected marker image in WebXR
34
+ * @category XR
35
+ */
23
36
  export class WebXRTrackedImage {
24
37
 
38
+ /** URL of the tracked marker image */
25
39
  get url(): string { return this._trackedImage.image ?? ""; }
40
+ /** Physical width of the marker in meters */
26
41
  get widthInMeters() { return this._trackedImage.widthInMeters ?? undefined; }
42
+ /** The ImageBitmap used for tracking */
27
43
  get bitmap(): ImageBitmap { return this._bitmap; }
44
+ /** The {@link WebXRImageTrackingModel} configuration for this tracked image */
28
45
  get model(): WebXRImageTrackingModel { return this._trackedImage; }
46
+ /**
47
+ * The measured size of the detected image in the real world.
48
+ * May differ from `widthInMeters` if the physical marker doesn't match the configured size.
49
+ */
29
50
  readonly measuredSize: number;
51
+ /**
52
+ * Current tracking state of the image:
53
+ * - `tracked` - Image is currently being tracked by the system
54
+ * - `emulated` - Tracking is being emulated (less accurate)
55
+ */
30
56
  readonly state: "tracked" | "emulated";
31
57
 
32
- /** Copy the image position to a vector */
58
+ /**
59
+ * Copy the current world position of the tracked image to a Vector3.
60
+ * @param vec The vector to store the position in
61
+ * @returns The input vector with the position copied to it
62
+ */
33
63
  getPosition(vec: Vector3) {
34
64
  this.ensureTransformData();
35
65
  vec.copy(this._position);
36
66
  return vec;
37
67
  }
38
68
 
39
- /** Copy the image rotation to a quaternion */
69
+ /**
70
+ * Copy the current world rotation of the tracked image to a Quaternion.
71
+ * @param quat The quaternion to store the rotation in
72
+ * @returns The input quaternion with the rotation copied to it
73
+ */
40
74
  getQuaternion(quat: Quaternion) {
41
75
  this.ensureTransformData();
42
76
  quat.copy(this._rotation);
43
77
  return quat;
44
78
  }
45
79
 
80
+ /**
81
+ * Apply the tracked image's position and rotation to a 3D object.
82
+ * Optionally applies smoothing to reduce jitter.
83
+ *
84
+ * @param object The 3D object to update
85
+ * @param t01 Interpolation factor (0-1) for smoothing. If undefined or >= 1, no smoothing is applied. When smoothing is enabled, larger position/rotation changes will automatically reduce the smoothing to prevent lag.
86
+ */
46
87
  applyToObject(object: Object3D, t01: number | undefined = undefined) {
47
88
  this.ensureTransformData();
48
89
  // check if position/_position or rotation/_rotation changed more than just a little bit and adjust smoothing accordingly
@@ -92,14 +133,22 @@ export class WebXRTrackedImage {
92
133
 
93
134
  }
94
135
 
136
+ /**
137
+ * Event callback type for image tracking updates.
138
+ * @param images Array of currently tracked images
139
+ */
95
140
  declare type WebXRImageTrackingEvent = (images: WebXRImageTrackingEvent[]) => void;
96
141
 
97
- /** Initial state of assigned tracked image objects that are already present in the scene
98
- * This is used to restore the state of the object when the webxr session has ended to return to the original state
142
+ /**
143
+ * Initial state of tracked image objects before entering an XR session.
144
+ * Used to restore objects to their original state when the WebXR session ends.
99
145
  */
100
146
  declare type InitialTrackedObjectState = {
147
+ /** Original visibility state */
101
148
  visible: boolean;
149
+ /** Original parent object in the scene hierarchy */
102
150
  parent: Object3D | undefined | null;
151
+ /** Original transformation matrix */
103
152
  matrix: Matrix4;
104
153
  }
105
154
 
@@ -107,13 +156,37 @@ declare type InitialTrackedObjectState = {
107
156
  // #region Model
108
157
 
109
158
  /**
110
- * WebXRImageTracking allows you to track images in the real world and place objects on top of them.
111
- * This component is only available in WebXR sessions.
112
- * The WebXRImageTrackingModel contains the image to track, the object to place on top of the image, and the size of the image as well as settings for the tracking.
113
- * Used by the {@link WebXRImageTracking} component
159
+ * Configuration model for a tracked image marker.
160
+ * Defines which image to track, its physical size, and which 3D content to display when detected.
161
+ *
162
+ * **Important:** The physical size (`widthInMeters`) must match your printed marker size for accurate tracking.
163
+ * Mismatched sizes cause the tracked object to appear to "float" above or below the marker.
164
+ *
165
+ * **Best practices for marker images:**
166
+ * - Use high-contrast images with distinct features
167
+ * - Avoid repetitive patterns or solid colors
168
+ * - Test images at intended viewing distances
169
+ * - Ensure good lighting conditions
170
+ *
171
+ * @summary Configuration for a single trackable image marker
172
+ * @category XR
173
+ * @see {@link WebXRImageTracking} for the component that uses these models
174
+ * @link https://engine.needle.tools/docs/xr.html#image-tracking
175
+ * @link https://engine.needle.tools/samples/image-tracking
114
176
  */
115
177
  export class WebXRImageTrackingModel {
116
178
 
179
+ /**
180
+ * Creates a new image tracking configuration.
181
+ *
182
+ * @param params Configuration parameters
183
+ * @param params.url URL to the marker image to track
184
+ * @param params.widthInMeters Physical width of the printed marker in meters (must match real size!)
185
+ * @param params.object The 3D object or AssetReference to display when this image is detected
186
+ * @param params.createObjectInstance If true, creates a new instance for each detection (useful for tracking multiple instances of the same marker)
187
+ * @param params.imageDoesNotMove Enable for static markers (floor/wall mounted) to improve tracking stability
188
+ * @param params.hideWhenTrackingIsLost If true, hides the object when tracking is lost; if false, leaves it at the last known position
189
+ */
117
190
  constructor(params: { url: string, widthInMeters: number, /** Object to track */ object: AssetReference | Object3D, createObjectInstance?: boolean, imageDoesNotMove?: boolean, hideWhenTrackingIsLost?: boolean }) {
118
191
  this.image = params.url;
119
192
  this.widthInMeters = params.widthInMeters;
@@ -121,44 +194,81 @@ export class WebXRImageTrackingModel {
121
194
  this.object = new AssetReference({ asset: params.object });
122
195
  }
123
196
  else this.object = params.object;
124
-
197
+
125
198
  if (params.createObjectInstance !== undefined) this.createObjectInstance = params.createObjectInstance;
126
199
  if (params.imageDoesNotMove !== undefined) this.imageDoesNotMove = params.imageDoesNotMove;
127
200
  if (params.hideWhenTrackingIsLost !== undefined) this.hideWhenTrackingIsLost = params.hideWhenTrackingIsLost;
128
201
  }
129
202
 
130
203
  /**
131
- * Tracked image marker url. Make sure the image has good contrast and unique features to improve the tracking quality.
204
+ * URL to the marker image to track.
205
+ * **Important:** Use images with high contrast and unique features to improve tracking quality.
206
+ * Avoid repetitive patterns, solid colors, or low-contrast images.
132
207
  */
133
208
  @serializable(URL)
134
209
  image?: string;
135
210
 
136
- /** Make sure this matches your physical marker size! Otherwise the tracked object will \"swim\" above or below the marker.
137
- * @default 0.25 which is equivalent to 25cm
211
+ /**
212
+ * Physical width of the printed marker in meters.
213
+ * **Critical:** This must match your actual printed marker size!
214
+ * If mismatched, the tracked object will appear to "float" above or below the marker.
215
+ *
216
+ * @default 0.25 (25cm)
217
+ * @example
218
+ * ```ts
219
+ * // For a business card sized marker (9cm wide)
220
+ * widthInMeters = 0.09;
221
+ *
222
+ * // For an A4 page width (21cm)
223
+ * widthInMeters = 0.21;
224
+ * ```
138
225
  */
139
226
  @serializable()
140
227
  widthInMeters: number = .25;
141
228
 
142
229
  /**
143
- * The object moved around by the image. Make sure the size matches WidthInMeters.
230
+ * The 3D object or prefab to display when this marker is detected.
231
+ * The object will be positioned and rotated to match the tracked image in the real world.
232
+ *
233
+ * **Note:** Scale your 3D content appropriately relative to `widthInMeters`.
144
234
  */
145
235
  @serializable(AssetReference)
146
236
  object?: AssetReference;
147
237
 
148
238
  /**
149
- * If true, a new instance of the referenced object will be created for each tracked image. Enable this if you're re-using objects for multiple markers.
239
+ * When enabled, creates a new instance of the referenced object each time this image is detected.
240
+ * Enable this if you want to track multiple instances of the same marker simultaneously,
241
+ * or if the same object is used for multiple different markers.
242
+ *
243
+ * @default false
150
244
  */
151
245
  @serializable()
152
246
  createObjectInstance: boolean = false;
153
247
 
154
- /** Use this for static images (e.g. markers on the floor). Only the first few frames of new poses will be applied to the model. This will result in more stable tracking.
248
+ /**
249
+ * Enable for static markers that don't move (e.g., posters on walls or markers on the floor).
250
+ * When enabled, only the first few tracking frames are used to position the object,
251
+ * resulting in more stable tracking by ignoring subsequent minor position changes.
252
+ *
253
+ * **Use cases:**
254
+ * - Wall-mounted posters or artwork
255
+ * - Floor markers for persistent AR content
256
+ * - Product packaging on shelves
257
+ *
258
+ * **Don't use for:**
259
+ * - Handheld cards or objects
260
+ * - Moving markers
261
+ *
155
262
  * @default false
156
263
  */
157
264
  @serializable()
158
265
  imageDoesNotMove: boolean = false;
159
266
 
160
267
  /**
161
- * Enable to hide the tracked object when the image is not tracked anymore. When disabled the tracked object will stay at the position it was last tracked at.
268
+ * Controls visibility behavior when tracking is lost.
269
+ * - When `true`: Object is hidden when the marker is no longer visible
270
+ * - When `false`: Object remains visible at its last tracked position
271
+ *
162
272
  * @default true
163
273
  */
164
274
  @serializable()
@@ -166,7 +276,13 @@ export class WebXRImageTrackingModel {
166
276
 
167
277
 
168
278
  /**
169
- * Get the name of the image file from the url
279
+ * Extracts the filename from the marker image URL.
280
+ * @returns The filename (last part of the URL path), or null if no image URL is set
281
+ * @example
282
+ * ```ts
283
+ * // URL: "https://example.com/markers/business-card.png"
284
+ * // Returns: "business-card.png"
285
+ * ```
170
286
  */
171
287
  getNameFromUrl() {
172
288
  if (this.image) {
@@ -299,24 +415,121 @@ class ImageTrackingExtension implements IUSDExporterExtension {
299
415
 
300
416
  // #region Tracking Component
301
417
  /**
302
- * Add this component to a object to enable image tracking in WebXR sessions.
303
- *
304
- * You need to add at least one {@link WebXRImageTrackingModel} to the `trackedImages` array to define which images to track and which objects to place on top of them.
418
+ * Create powerful AR image tracking experiences with just a few lines of code!
419
+ * WebXRImageTracking makes it incredibly easy to detect marker images in the real world and anchor 3D content to them.
420
+ * Needle Engine automatically handles all the complexity across different platforms and fallback modes for you.
421
+ *
422
+ * [![Image Tracking Demo](https://cloud.needle.tools/-/media/vRUf9BmqW_bgNARATjmfCQ.gif)](https://engine.needle.tools/samples/image-tracking)
423
+ *
424
+ * **What makes Needle Engine special:**
425
+ * - **Write once, run everywhere**: The same code works across iOS, Android, and visionOS
426
+ * - **Automatic platform optimization**: Seamlessly switches between WebXR, ARKit, and QuickLook
427
+ * - **Flexible deployment options**: From full WebXR with unlimited markers to QuickLook fallback
428
+ * - **Production ready**: Battle-tested tracking with adaptive smoothing and stability features
429
+ *
430
+ * **Platform Support & Options:**
431
+ * - **iOS (WebXR via AppClip)**: Full WebXR support - track unlimited markers simultaneously via native ARKit!
432
+ * - **iOS (QuickLook mode)**: Instant AR without app installation - perfect for quick demos (tracks first marker)
433
+ * - **Android (WebXR)**: Native WebXR Image Tracking API - unlimited markers (requires browser flag during early access)
434
+ * - **visionOS (QuickLook)**: Spatial image anchoring with Apple's AR QuickLook
435
+ *
436
+ * **Simple 3-Step Setup:**
437
+ * 1. Add this component to any GameObject in your scene
438
+ * 2. Configure your markers in the `trackedImages` array:
439
+ * - `image`: URL to your marker image
440
+ * - `widthInMeters`: Physical size of your printed marker
441
+ * - `object`: The 3D content to display
442
+ * 3. Export and test - Needle handles the rest!
443
+ *
444
+ * **Pro Tips for Best Results:**
445
+ * - Use high-contrast markers with unique features for reliable tracking
446
+ * - Match `widthInMeters` to your actual physical marker size for accurate positioning
447
+ * - Enable `imageDoesNotMove` for wall posters or floor markers - significantly improves stability
448
+ * - Use `smooth` (enabled by default) for professional-looking, jitter-free tracking
449
+ * - Test with different marker sizes and lighting - Needle's adaptive tracking handles various conditions
305
450
  *
306
- * **NOTE:** For Android devices, image tracking currently requires the user to enable the `chrome://flags/#webxr-incubations` flag in Chrome.
307
- *
308
- * **NOTE:** For iOS only one image can be tracked at a time. If you have multiple images in the `trackedImages` array, only the first one will be tracked. You can use the {@link setPrimaryImage} method to change which image is tracked before entering the XR session.
309
- *
310
- * - Example: https://samples.needle.tools/image-tracking
451
+ * ![](https://cloud.needle.tools/-/media/V-2UxGVRJxvH9oDnXGnIdg.png)
452
+ * *WebXRImageTracking component in Unity Editor*
311
453
  *
454
+ * ![](https://cloud.needle.tools/-/media/poDPca1bI1an4SBY7LtKNA.png)
455
+ * *WebXRImageTracking panel/component in Blender*
456
+ *
457
+ * @example Getting started - it's this easy!
458
+ * ```ts
459
+ * // Just add markers and Needle handles everything else
460
+ * const imageTracking = myObject.addComponent(WebXRImageTracking);
461
+ * const marker = new WebXRImageTrackingModel({
462
+ * url: "https://example.com/my-poster.png",
463
+ * widthInMeters: 0.3, // 30cm poster
464
+ * object: my3DContent
465
+ * });
466
+ * imageTracking.addImage(marker);
467
+ * // Done! Works on iOS, Android, and visionOS automatically
468
+ * ```
469
+ *
470
+ * @example Track multiple markers (WebXR mode)
471
+ * ```ts
472
+ * const imageTracking = myObject.addComponent(WebXRImageTracking);
473
+ *
474
+ * // In WebXR mode (iOS AppClip, Android), all markers work simultaneously!
475
+ * const productBox = new WebXRImageTrackingModel({ url: "product-box.png", widthInMeters: 0.15, object: productInfo });
476
+ * const businessCard = new WebXRImageTrackingModel({ url: "business-card.png", widthInMeters: 0.09, object: contactCard });
477
+ * const poster = new WebXRImageTrackingModel({ url: "poster.png", widthInMeters: 0.5, object: videoPlayer });
478
+ *
479
+ * imageTracking.addImage(productBox);
480
+ * imageTracking.addImage(businessCard);
481
+ * imageTracking.addImage(poster);
482
+ *
483
+ * // For QuickLook fallback mode, optionally set which marker is primary
484
+ * imageTracking.setPrimaryImage(poster); // This will be used in QuickLook
485
+ * ```
486
+ *
487
+ * @example Professional setup for static markers
488
+ * ```ts
489
+ * // Perfect for museums, retail displays, or permanent installations
490
+ * const wallArt = new WebXRImageTrackingModel({
491
+ * url: "gallery-painting.png",
492
+ * widthInMeters: 0.6,
493
+ * object: interactiveExplanation,
494
+ * imageDoesNotMove: true, // Rock-solid tracking for static markers!
495
+ * hideWhenTrackingIsLost: false // Content stays visible even if temporarily occluded
496
+ * });
497
+ * ```
498
+ *
499
+ * **Why developers love Needle's image tracking:**
500
+ * - Zero platform-specific code required
501
+ * - Automatic graceful degradation across deployment modes
502
+ * - Built-in jitter reduction and stability features
503
+ * - Works with any image - posters, packaging, business cards, artwork
504
+ * - Export once, deploy everywhere
505
+ *
506
+ * @summary The easiest way to create cross-platform AR image tracking experiences
312
507
  * @category XR
313
508
  * @group Components
509
+ * @see {@link WebXRImageTrackingModel} for marker configuration options
510
+ * @see {@link WebXRTrackedImage} for runtime tracking data and events
511
+ * @see {@link WebXR} for general WebXR setup and session management
512
+ * @link https://engine.needle.tools/docs/xr.html#image-tracking - Full Documentation
513
+ * @link https://engine.needle.tools/samples/image-tracking - Try Live Demo
514
+ * @link https://github.com/immersive-web/marker-tracking/blob/main/explainer.md - WebXR Marker Tracking Specification
314
515
  */
315
516
  export class WebXRImageTracking extends Behaviour {
316
517
 
317
518
  /**
318
- * If you have multiple images in your application to track then this method is useful for iOS AR where only the first image can be tracked.
319
- * Call this method will set the given image as the first one in the array so it will be used for tracking.
519
+ * Set which marker should be primary (first in the list).
520
+ * Useful when deploying to QuickLook mode where one marker is tracked at a time.
521
+ * In full WebXR mode (iOS AppClip, Android), all markers track simultaneously regardless of order.
522
+ *
523
+ * **Note:** Needle Engine automatically adapts - in WebXR all markers work, in QuickLook the primary is used.
524
+ *
525
+ * @param image The marker model to set as primary
526
+ *
527
+ * @example
528
+ * ```ts
529
+ * // Great for offering different AR experiences from one deployment
530
+ * imageTracking.setPrimaryImage(businessCardMarker); // Use this for QuickLook
531
+ * // In WebXR mode, all markers still work simultaneously!
532
+ * ```
320
533
  */
321
534
  setPrimaryImage(image: WebXRImageTrackingModel) {
322
535
  const index = this.trackedImages.indexOf(image);
@@ -331,14 +544,25 @@ export class WebXRImageTracking extends Behaviour {
331
544
  }
332
545
 
333
546
  /**
334
- * Add an image to track. If the image is already in the trackedImages array it won't be added again.
335
- * Note: that adding images at runtime *while* in AR is not supported.
336
- *
547
+ * Add a marker to track - it's that simple!
548
+ * Needle Engine handles all the platform differences automatically.
549
+ *
550
+ * **Tip:** Add all your markers upfront. In WebXR mode they all work simultaneously.
551
+ * In QuickLook mode, the first (primary) marker is used.
552
+ *
553
+ * @param image The marker configuration to add
554
+ * @param asPrimary Set to true to make this the primary marker (for QuickLook fallback)
555
+ *
337
556
  * @example
338
557
  * ```ts
339
- * const imageTracking = GameObject.getComponent(myGameObject, WebXRImageTracking);
340
- * const image = new WebXRImageTrackingModel({ url: "https://example.com/my-marker.png", widthInMeters: 0.2, object: myObject });
341
- * imageTracking.addImage(image, true); // add and set as primary image
558
+ * // Super simple - works across all platforms
559
+ * const marker = new WebXRImageTrackingModel({
560
+ * url: "https://mysite.com/poster.png",
561
+ * widthInMeters: 0.42, // A3 poster width
562
+ * object: cool3DModel
563
+ * });
564
+ * imageTracking.addImage(marker);
565
+ * // That's it! Needle does the rest.
342
566
  * ```
343
567
  */
344
568
  addImage(image: WebXRImageTrackingModel, asPrimary: boolean = false) {
@@ -351,20 +575,40 @@ export class WebXRImageTracking extends Behaviour {
351
575
 
352
576
 
353
577
  /**
354
- * List of images to track in the WebXR session. Use {@link WebXRImageTrackingModel} to define each image and the object to place on top of it.
355
- *
356
- * Use the `addImage()` and `setPrimaryImage()` methods to modify this array at runtime.
578
+ * Your list of markers to track. Add as many as you need!
579
+ *
580
+ * **How it works across platforms:**
581
+ * - **WebXR mode** (iOS AppClip, Android): All markers are tracked simultaneously - amazing for multi-marker experiences!
582
+ * - **QuickLook mode** (iOS fallback, visionOS): First marker is used - perfect for quick demos without app installation
583
+ *
584
+ * **Needle's smart deployment:** Configure all your markers once, and Needle automatically uses the best
585
+ * tracking mode available on each platform. No platform-specific code needed!
586
+ *
587
+ * @see {@link WebXRImageTrackingModel} for marker configuration
588
+ * @see {@link addImage} and {@link setPrimaryImage} for runtime management
357
589
  */
358
590
  @serializable(WebXRImageTrackingModel)
359
591
  readonly trackedImages: WebXRImageTrackingModel[] = [];
360
592
 
361
- /** Applies smoothing based on detected jitter to the tracked image. */
593
+ /**
594
+ * Enable Needle's professional-grade adaptive smoothing for rock-solid tracking.
595
+ * Automatically reduces jitter while staying responsive to real movement.
596
+ *
597
+ * **Pro tip:** Keep this enabled (default) for production experiences!
598
+ *
599
+ * @default true
600
+ */
362
601
  @serializable()
363
602
  smooth: boolean = true;
364
603
 
365
604
  private readonly trackedImageIndexMap: Map<number, WebXRImageTrackingModel> = new Map();
366
605
 
367
- /** @returns true if image tracking is supported on this device. This may return false at runtime if the user's browser did not enable webxr incubations */
606
+ /**
607
+ * Check if image tracking is available on this device right now.
608
+ *
609
+ * **Note:** On Android Chrome, WebXR Image Tracking is currently behind a flag during the early access period.
610
+ * Needle automatically falls back to other modes when needed, so your experience keeps working!
611
+ */
368
612
  get supported() { return this._supported; }
369
613
 
370
614
  private _supported: boolean = true;
@@ -48,7 +48,7 @@ export declare type WebXRPlaneTrackingEvent = {
48
48
  }
49
49
 
50
50
  /**
51
- * Use this component to track planes and meshes in the real world when in immersive-ar (e.g. on Oculus Quest).
51
+ * [WebXRPlaneTracking](https://engine.needle.tools/docs/api/WebXRPlaneTracking) tracks planes and meshes in the real world when in immersive-ar (e.g. on Oculus Quest).
52
52
  * @category XR
53
53
  * @group Components
54
54
  */
@@ -61,12 +61,39 @@ export class XRState {
61
61
  }
62
62
 
63
63
  /**
64
- * Use the XRFlag component to show or hide objects based on the current XR state or session.
65
- * This means you can show or hide objects based on if the user is in VR, AR, using first person view or third person view.
66
- *
64
+ * XRFlag shows or hides GameObjects based on the current XR state or session.
65
+ * Use for XR-responsive content that should only appear in specific modes.
66
+ *
67
+ * **XR states:**
68
+ * - `Browser` - Normal web browsing (no XR)
69
+ * - `AR` - Augmented reality session
70
+ * - `VR` - Virtual reality session
71
+ * - `FirstPerson` - First-person view mode
72
+ * - `ThirdPerson` - Third-person/spectator view mode
73
+ * - Combine with bitwise OR: `AR | VR`
74
+ *
75
+ * **Debug options:**
76
+ * - `?debugxrflags` - Log flag changes
77
+ * - `?disablexrflags` - Disable all XR flags
78
+ *
79
+ * @example Show only in VR
80
+ * ```ts
81
+ * const flag = myObject.addComponent(XRFlag);
82
+ * flag.visibleIn = XRStateFlag.VR;
83
+ * ```
84
+ *
85
+ * @example Show in AR and VR, hide in browser
86
+ * ```ts
87
+ * flag.visibleIn = XRStateFlag.AR | XRStateFlag.VR;
88
+ * ```
89
+ *
67
90
  * @category XR
68
91
  * @category Utilities
69
92
  * @group Components
93
+ * @see {@link XRStateFlag} for state options
94
+ * @see {@link XRState} for global state management
95
+ * @see {@link DeviceFlag} for device-based visibility
96
+ * @see {@link WebXR} for XR session management
70
97
  */
71
98
  export class XRFlag extends Behaviour {
72
99