@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
@@ -2,39 +2,168 @@ import { AnimationClip } from "three";
2
2
  import { ScaleClipType } from "../../engine/engine_animation.js";
3
3
  import { Behaviour } from "../Component.js";
4
4
  /**
5
- * Plays a hover animation on the object this component was added to when the mouse pointer (or touch) is over the object or any of it's children.
5
+ * [HoverAnimation](https://engine.needle.tools/docs/api/HoverAnimation) plays animations in response to pointer hover events on the object this component is attached to.
6
+ * The component automatically detects when the mouse pointer or touch enters/exits the object or any of its children, triggering the corresponding animations.
6
7
  *
7
- * By default, a simple scale-up animation is used. You can customize the hover and idle animations by providing your own animation clips.
8
+ * **How It Works:**
9
+ * The component listens to pointer enter and exit events and switches between two animation states:
10
+ * - **Hover state**: Plays when the pointer enters the object (default: scale up to 110%)
11
+ * - **Idle state**: Plays when the pointer exits the object (default: returns to original scale)
8
12
  *
9
- * @summary Hover Animation on Pointer Enter/Exit
13
+ * **Default Behavior:**
14
+ * If no custom animation clips are provided, the component automatically creates a smooth scale-up animation using the
15
+ * {@link type}, {@link duration}, and {@link scaleFactor} properties. This provides instant hover feedback without
16
+ * requiring any animation setup.
17
+ *
18
+ * **Custom Animations:**
19
+ * You can provide your own animation clips for complete control over the hover effect. This allows you to create
20
+ * complex animations involving position, rotation, color changes, or any other animated property.
21
+ *
22
+ * **Common Use Cases:**
23
+ * - Interactive buttons with scale feedback
24
+ * - Product showcases with highlight animations
25
+ * - Menu items with hover effects
26
+ * - Interactive 3D objects in AR/VR experiences
27
+ * - Call-to-action elements with attention-grabbing animations
28
+ *
29
+ * @example Basic usage with default scale animation
30
+ * ```ts
31
+ * const button = new Object3D();
32
+ * button.addComponent(HoverAnimation, {
33
+ * scaleFactor: 1.2, // Scale to 120% on hover
34
+ * duration: 0.2, // 200ms animation
35
+ * type: "ease-in-out" // Smooth easing
36
+ * });
37
+ * scene.add(button);
38
+ * ```
39
+ *
40
+ * @example Custom hover animations
41
+ * ```ts
42
+ * const obj = new Object3D();
43
+ * const hoverAnim = loadAnimationClip("hover-glow.anim");
44
+ * const idleAnim = loadAnimationClip("idle-pulse.anim");
45
+ *
46
+ * obj.addComponent(HoverAnimation, {
47
+ * hovered: hoverAnim, // Custom hover animation
48
+ * idle: idleAnim // Custom idle animation
49
+ * });
50
+ * scene.add(obj);
51
+ * ```
52
+ *
53
+ * @example Quick scale animation with custom settings
54
+ * ```ts
55
+ * gameObject.addComponent(HoverAnimation, {
56
+ * scaleFactor: 1.15,
57
+ * duration: 0.15,
58
+ * type: "ease-out"
59
+ * });
60
+ * ```
61
+ *
62
+ * @see {@link Animation} - The underlying animation component used to play clips
63
+ * @see {@link AnimationClip} - For creating custom animation clips
64
+ * @see {@link AnimationUtils} - Utility functions for creating animations programmatically
65
+ * @see {@link ScaleClipType} - Available easing types for the default scale animation
66
+ * @see {@link ObjectRaycaster} - Controls which objects receive pointer events
67
+ * @see {@link PointerEvents} - For more complex pointer interaction handling
68
+ *
69
+ * @summary Plays animations on pointer hover enter/exit events
10
70
  * @category Interactivity
11
71
  * @group Components
72
+ * @component
12
73
  */
13
74
  export declare class HoverAnimation extends Behaviour {
14
75
  /**
15
- * Default hover animation type if no custom clip is provided.
16
- * **Node**: This is only used if no custom hover animation clip is provided.
76
+ * The easing type for the default scale animation.
77
+ *
78
+ * This property controls how the scale animation interpolates from the start to end value.
79
+ * Different easing types create different "feels" for the hover effect.
80
+ *
81
+ * **Available types:**
82
+ * - `"linear"`: Constant speed throughout the animation
83
+ * - `"ease-in"`: Starts slow, ends fast
84
+ * - `"ease-out"`: Starts fast, ends slow (good for responsive feel)
85
+ * - `"ease-in-out"`: Starts slow, fast in middle, ends slow (smooth and natural)
86
+ *
87
+ * **Note:** This is only used when no custom {@link hovered} animation clip is provided.
88
+ * If you provide a custom animation clip, this property is ignored.
89
+ *
90
+ * @see {@link ScaleClipType} for all available easing types
17
91
  * @default "linear"
18
92
  */
19
93
  type: ScaleClipType;
20
94
  /**
21
- * Duration of the hover animation in seconds.
22
- * **Node**: This is only used if no custom hover animation clip is provided.
95
+ * Duration of the default hover animation in seconds.
96
+ *
97
+ * This controls how long it takes for the object to scale up when hovered.
98
+ * Shorter durations feel more responsive, while longer durations feel smoother.
99
+ *
100
+ * **Recommendations:**
101
+ * - `0.1-0.15s`: Snappy, responsive feel (good for buttons)
102
+ * - `0.2-0.3s`: Smooth, noticeable animation
103
+ * - `0.4s+`: Slow, emphasized effect
104
+ *
105
+ * **Note:** This is only used when no custom {@link hovered} animation clip is provided.
106
+ * If you provide a custom animation clip, this property is ignored.
107
+ *
23
108
  * @default 0.1
24
109
  */
25
110
  duration: number;
26
111
  /**
27
- * Scale factor to apply when hovering.
28
- * **Node**: This is only used if no custom hover animation clip is provided.
112
+ * The scale multiplier to apply when the object is hovered.
113
+ *
114
+ * This value is multiplied with the object's original scale to determine the hover size.
115
+ * A value of `1.0` means no change, values greater than `1.0` scale up, and values less than `1.0` scale down.
116
+ *
117
+ * **Examples:**
118
+ * - `1.0`: No scale change
119
+ * - `1.1`: Scale to 110% (subtle effect, default)
120
+ * - `1.2`: Scale to 120% (noticeable effect)
121
+ * - `1.5`: Scale to 150% (dramatic effect)
122
+ * - `0.9`: Scale to 90% (shrink on hover)
123
+ *
124
+ * **Note:** This is only used when no custom {@link hovered} animation clip is provided.
125
+ * If you provide a custom animation clip, this property is ignored.
126
+ *
29
127
  * @default 1.1
30
128
  */
31
129
  scaleFactor: number;
32
130
  /**
33
- * Animation clip to play when hovering. If null, a default scale-up animation is used.
131
+ * Custom animation clip to play when the pointer hovers over the object.
132
+ *
133
+ * If `null`, the component automatically generates a scale-up animation based on the
134
+ * {@link type}, {@link duration}, and {@link scaleFactor} properties.
135
+ *
136
+ * Provide a custom animation clip if you want more complex hover effects such as:
137
+ * - Color changes or material property animations
138
+ * - Position or rotation changes
139
+ * - Multi-property animations
140
+ * - Animations affecting child objects
141
+ *
142
+ * **Tip:** The animation plays with a 0.1s fade duration for smooth transitions.
143
+ *
144
+ * @see {@link AnimationClip} for creating custom animation clips
145
+ * @see {@link AnimationUtils.createScaleClip} for programmatically creating scale animations
146
+ * @default null (generates default scale animation)
34
147
  */
35
148
  hovered: AnimationClip | null;
36
149
  /**
37
- * Animation clip to play when not hovering. If null, an empty clip is used.
150
+ * Custom animation clip to play when the pointer is not hovering over the object (idle state).
151
+ *
152
+ * If `null`, an empty animation clip is used, which returns the object to its original state
153
+ * when the hover animation ends.
154
+ *
155
+ * You can provide a custom idle animation for effects such as:
156
+ * - Subtle breathing or floating motion when not hovered
157
+ * - Pulsing or glowing effects in idle state
158
+ * - Return-to-normal animations with custom easing
159
+ * - Looping ambient animations
160
+ *
161
+ * **Tip:** The idle animation is played with `loop: true`, so it will repeat continuously
162
+ * until the object is hovered again.
163
+ *
164
+ * @see {@link AnimationClip} for creating custom animation clips
165
+ * @see {@link AnimationUtils.emptyClip} to see how the default empty clip is created
166
+ * @default null (uses empty clip that returns to original state)
38
167
  */
39
168
  idle: AnimationClip | null;
40
169
  private animation;
@@ -11,39 +11,168 @@ import { registerType } from "../../engine/engine_typestore.js";
11
11
  import { Animation } from "../Animation.js";
12
12
  import { Behaviour } from "../Component.js";
13
13
  /**
14
- * Plays a hover animation on the object this component was added to when the mouse pointer (or touch) is over the object or any of it's children.
14
+ * [HoverAnimation](https://engine.needle.tools/docs/api/HoverAnimation) plays animations in response to pointer hover events on the object this component is attached to.
15
+ * The component automatically detects when the mouse pointer or touch enters/exits the object or any of its children, triggering the corresponding animations.
15
16
  *
16
- * By default, a simple scale-up animation is used. You can customize the hover and idle animations by providing your own animation clips.
17
+ * **How It Works:**
18
+ * The component listens to pointer enter and exit events and switches between two animation states:
19
+ * - **Hover state**: Plays when the pointer enters the object (default: scale up to 110%)
20
+ * - **Idle state**: Plays when the pointer exits the object (default: returns to original scale)
17
21
  *
18
- * @summary Hover Animation on Pointer Enter/Exit
22
+ * **Default Behavior:**
23
+ * If no custom animation clips are provided, the component automatically creates a smooth scale-up animation using the
24
+ * {@link type}, {@link duration}, and {@link scaleFactor} properties. This provides instant hover feedback without
25
+ * requiring any animation setup.
26
+ *
27
+ * **Custom Animations:**
28
+ * You can provide your own animation clips for complete control over the hover effect. This allows you to create
29
+ * complex animations involving position, rotation, color changes, or any other animated property.
30
+ *
31
+ * **Common Use Cases:**
32
+ * - Interactive buttons with scale feedback
33
+ * - Product showcases with highlight animations
34
+ * - Menu items with hover effects
35
+ * - Interactive 3D objects in AR/VR experiences
36
+ * - Call-to-action elements with attention-grabbing animations
37
+ *
38
+ * @example Basic usage with default scale animation
39
+ * ```ts
40
+ * const button = new Object3D();
41
+ * button.addComponent(HoverAnimation, {
42
+ * scaleFactor: 1.2, // Scale to 120% on hover
43
+ * duration: 0.2, // 200ms animation
44
+ * type: "ease-in-out" // Smooth easing
45
+ * });
46
+ * scene.add(button);
47
+ * ```
48
+ *
49
+ * @example Custom hover animations
50
+ * ```ts
51
+ * const obj = new Object3D();
52
+ * const hoverAnim = loadAnimationClip("hover-glow.anim");
53
+ * const idleAnim = loadAnimationClip("idle-pulse.anim");
54
+ *
55
+ * obj.addComponent(HoverAnimation, {
56
+ * hovered: hoverAnim, // Custom hover animation
57
+ * idle: idleAnim // Custom idle animation
58
+ * });
59
+ * scene.add(obj);
60
+ * ```
61
+ *
62
+ * @example Quick scale animation with custom settings
63
+ * ```ts
64
+ * gameObject.addComponent(HoverAnimation, {
65
+ * scaleFactor: 1.15,
66
+ * duration: 0.15,
67
+ * type: "ease-out"
68
+ * });
69
+ * ```
70
+ *
71
+ * @see {@link Animation} - The underlying animation component used to play clips
72
+ * @see {@link AnimationClip} - For creating custom animation clips
73
+ * @see {@link AnimationUtils} - Utility functions for creating animations programmatically
74
+ * @see {@link ScaleClipType} - Available easing types for the default scale animation
75
+ * @see {@link ObjectRaycaster} - Controls which objects receive pointer events
76
+ * @see {@link PointerEvents} - For more complex pointer interaction handling
77
+ *
78
+ * @summary Plays animations on pointer hover enter/exit events
19
79
  * @category Interactivity
20
80
  * @group Components
81
+ * @component
21
82
  */
22
83
  let HoverAnimation = class HoverAnimation extends Behaviour {
23
84
  /**
24
- * Default hover animation type if no custom clip is provided.
25
- * **Node**: This is only used if no custom hover animation clip is provided.
85
+ * The easing type for the default scale animation.
86
+ *
87
+ * This property controls how the scale animation interpolates from the start to end value.
88
+ * Different easing types create different "feels" for the hover effect.
89
+ *
90
+ * **Available types:**
91
+ * - `"linear"`: Constant speed throughout the animation
92
+ * - `"ease-in"`: Starts slow, ends fast
93
+ * - `"ease-out"`: Starts fast, ends slow (good for responsive feel)
94
+ * - `"ease-in-out"`: Starts slow, fast in middle, ends slow (smooth and natural)
95
+ *
96
+ * **Note:** This is only used when no custom {@link hovered} animation clip is provided.
97
+ * If you provide a custom animation clip, this property is ignored.
98
+ *
99
+ * @see {@link ScaleClipType} for all available easing types
26
100
  * @default "linear"
27
101
  */
28
102
  type = "linear";
29
103
  /**
30
- * Duration of the hover animation in seconds.
31
- * **Node**: This is only used if no custom hover animation clip is provided.
104
+ * Duration of the default hover animation in seconds.
105
+ *
106
+ * This controls how long it takes for the object to scale up when hovered.
107
+ * Shorter durations feel more responsive, while longer durations feel smoother.
108
+ *
109
+ * **Recommendations:**
110
+ * - `0.1-0.15s`: Snappy, responsive feel (good for buttons)
111
+ * - `0.2-0.3s`: Smooth, noticeable animation
112
+ * - `0.4s+`: Slow, emphasized effect
113
+ *
114
+ * **Note:** This is only used when no custom {@link hovered} animation clip is provided.
115
+ * If you provide a custom animation clip, this property is ignored.
116
+ *
32
117
  * @default 0.1
33
118
  */
34
119
  duration = 0.1;
35
120
  /**
36
- * Scale factor to apply when hovering.
37
- * **Node**: This is only used if no custom hover animation clip is provided.
121
+ * The scale multiplier to apply when the object is hovered.
122
+ *
123
+ * This value is multiplied with the object's original scale to determine the hover size.
124
+ * A value of `1.0` means no change, values greater than `1.0` scale up, and values less than `1.0` scale down.
125
+ *
126
+ * **Examples:**
127
+ * - `1.0`: No scale change
128
+ * - `1.1`: Scale to 110% (subtle effect, default)
129
+ * - `1.2`: Scale to 120% (noticeable effect)
130
+ * - `1.5`: Scale to 150% (dramatic effect)
131
+ * - `0.9`: Scale to 90% (shrink on hover)
132
+ *
133
+ * **Note:** This is only used when no custom {@link hovered} animation clip is provided.
134
+ * If you provide a custom animation clip, this property is ignored.
135
+ *
38
136
  * @default 1.1
39
137
  */
40
138
  scaleFactor = 1.1;
41
139
  /**
42
- * Animation clip to play when hovering. If null, a default scale-up animation is used.
140
+ * Custom animation clip to play when the pointer hovers over the object.
141
+ *
142
+ * If `null`, the component automatically generates a scale-up animation based on the
143
+ * {@link type}, {@link duration}, and {@link scaleFactor} properties.
144
+ *
145
+ * Provide a custom animation clip if you want more complex hover effects such as:
146
+ * - Color changes or material property animations
147
+ * - Position or rotation changes
148
+ * - Multi-property animations
149
+ * - Animations affecting child objects
150
+ *
151
+ * **Tip:** The animation plays with a 0.1s fade duration for smooth transitions.
152
+ *
153
+ * @see {@link AnimationClip} for creating custom animation clips
154
+ * @see {@link AnimationUtils.createScaleClip} for programmatically creating scale animations
155
+ * @default null (generates default scale animation)
43
156
  */
44
157
  hovered = null;
45
158
  /**
46
- * Animation clip to play when not hovering. If null, an empty clip is used.
159
+ * Custom animation clip to play when the pointer is not hovering over the object (idle state).
160
+ *
161
+ * If `null`, an empty animation clip is used, which returns the object to its original state
162
+ * when the hover animation ends.
163
+ *
164
+ * You can provide a custom idle animation for effects such as:
165
+ * - Subtle breathing or floating motion when not hovered
166
+ * - Pulsing or glowing effects in idle state
167
+ * - Return-to-normal animations with custom easing
168
+ * - Looping ambient animations
169
+ *
170
+ * **Tip:** The idle animation is played with `loop: true`, so it will repeat continuously
171
+ * until the object is hovered again.
172
+ *
173
+ * @see {@link AnimationClip} for creating custom animation clips
174
+ * @see {@link AnimationUtils.emptyClip} to see how the default empty clip is created
175
+ * @default null (uses empty clip that returns to original state)
47
176
  */
48
177
  idle = null;
49
178
  animation = null;
@@ -1 +1 @@
1
- {"version":3,"file":"HoverAnimation.js","sourceRoot":"","sources":["../../../src/engine-components/web/HoverAnimation.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;GAQG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,SAAS;IAEzC;;;;OAIG;IAEH,IAAI,GAAkB,QAAQ,CAAC;IAE/B;;;;OAIG;IAEH,QAAQ,GAAW,GAAG,CAAC;IAEvB;;;;OAIG;IAEH,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nD,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,cAAc;QACV,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IAED,aAAa;QACT,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAEO,QAAQ;QACZ,IAAI,IAAI,CAAC,IAAI;YAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACtG,CAAC;IACO,SAAS;QACb,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;IACtI,CAAC;CAEJ,CAAA;AAjIG;IADC,YAAY,EAAE;4CACgB;AAmB/B;IADC,YAAY,EAAE;gDACQ;AAqBvB;IADC,YAAY,EAAE;mDACW;AAsB1B;IADC,YAAY,CAAC,aAAa,CAAC;+CACS;AAsBrC;IADC,YAAY,CAAC,aAAa,CAAC;4CACM;AAzGzB,cAAc;IAD1B,YAAY;GACA,cAAc,CAsJ1B;SAtJY,cAAc"}
@@ -13,10 +13,13 @@ type ScrollFollowEvent = {
13
13
  defaultPrevented: boolean;
14
14
  };
15
15
  /**
16
- * The ScrollFollow component allows you to link the scroll position of the page (or a specific element) to one or more target objects.
16
+ * The [ScrollFollow](https://engine.needle.tools/docs/api/ScrollFollow) component allows you to link the scroll position of the page (or a specific element) to one or more target objects.
17
17
 
18
18
  * This can be used to create scroll-based animations, audio playback, or other effects. For example you can link the scroll position to a timeline (PlayableDirector) to create scroll-based storytelling effects or to an Animator component to change the animation state based on scroll.
19
19
  *
20
+ * ![](https://cloud.needle.tools/-/media/SYuH-vXxO4Jf30oU1HhjKQ.gif)
21
+ * ![](https://cloud.needle.tools/-/media/RplmU_j7-xb8XHXkOzc9PA.gif)
22
+ *
20
23
  * Assign {@link target} objects to the component to have them updated based on the current scroll position (check the 'target' property for supported types).
21
24
  *
22
25
  * @link Example at https://scrollytelling-2-z23hmxby7c6x-u30ld.needle.run/
@@ -22,10 +22,13 @@ import { SplineWalker } from "../splines/SplineWalker.js";
22
22
  import { PlayableDirector } from "../timeline/PlayableDirector.js";
23
23
  const debug = getParam("debugscroll");
24
24
  /**
25
- * The ScrollFollow component allows you to link the scroll position of the page (or a specific element) to one or more target objects.
25
+ * The [ScrollFollow](https://engine.needle.tools/docs/api/ScrollFollow) component allows you to link the scroll position of the page (or a specific element) to one or more target objects.
26
26
 
27
27
  * This can be used to create scroll-based animations, audio playback, or other effects. For example you can link the scroll position to a timeline (PlayableDirector) to create scroll-based storytelling effects or to an Animator component to change the animation state based on scroll.
28
28
  *
29
+ * ![](https://cloud.needle.tools/-/media/SYuH-vXxO4Jf30oU1HhjKQ.gif)
30
+ * ![](https://cloud.needle.tools/-/media/RplmU_j7-xb8XHXkOzc9PA.gif)
31
+ *
29
32
  * Assign {@link target} objects to the component to have them updated based on the current scroll position (check the 'target' property for supported types).
30
33
  *
31
34
  * @link Example at https://scrollytelling-2-z23hmxby7c6x-u30ld.needle.run/
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollFollow.js","sourceRoot":"","sources":["../../../src/engine-components/web/ScrollFollow.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAmC;AACnC,OAAO,kDAAkD,CAAC;AAE1D,OAAO,EAAQ,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAqC,MAAM,oCA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S,EAAE;QAClC,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC;KAClC;IACD,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IAC7G,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -1,21 +1,82 @@
1
1
  import { Behaviour } from "../Component.js";
2
+ /**
3
+ * Defines how the {@link ViewBox} component applies camera framing adjustments.
4
+ *
5
+ * - `"continuous"`: Camera framing is continuously updated while the ViewBox is active. Use for animated or dynamic ViewBoxes.
6
+ * - `"once"`: Camera framing is applied once when the ViewBox becomes active, then updates stop. Use for initial framing with subsequent user control.
7
+ */
2
8
  export type ViewBoxMode = "continuous" | "once";
3
9
  /**
4
- * This component can be used to automatically fit a certain box area into the camera view - no matter your screen size or aspect ratio.
5
- * This is useful for example to frame a character or object in the center of the screen and ensure it is always fully visible. You can also animate or scale the viewbox to create zoom or framing effects.
10
+ * [ViewBox](https://engine.needle.tools/docs/api/ViewBox) automatically fits a defined box area into the camera view regardless of screen size or aspect ratio.
11
+ * This component is useful for framing characters, objects, or scenes in the center of the view while ensuring they remain fully visible.
12
+ * You can animate or scale the viewbox to create dynamic zoom effects, cinematic transitions, or responsive framing.
13
+ *
14
+ * [![](https://cloud.needle.tools/-/media/Thy6svVftsIC6Z_wIxUJMA.gif)](https://engine.needle.tools/samples/bike-scrollytelling-responsive-3d)
15
+ *
16
+ * The ViewBox component works by adjusting the camera's focus rect settings (offset and zoom) to ensure that the box defined by the
17
+ * GameObject's position, rotation, and scale fits perfectly within the visible viewport. It supports different modes for one-time
18
+ * fitting or continuous adjustment, making it versatile for both static compositions and animated sequences.
19
+ *
20
+ * **Key Features:**
21
+ * - Automatically adjusts camera framing to fit the box area
22
+ * - Works with any screen size and aspect ratio
23
+ * - Supports one-time fitting or continuous updates
24
+ * - Can be animated for dynamic zoom and framing effects
25
+ * - Multiple ViewBoxes can be active, with the most recently enabled taking priority
26
+ * - Handles camera positioning to ensure the box is visible (moves camera if inside the box)
27
+ *
28
+ * **Common Use Cases:**
29
+ * - Character framing in cutscenes or dialogue
30
+ * - Product showcases with guaranteed visibility
31
+ * - Scrollytelling experiences with animated camera movements
32
+ * - Responsive layouts that adapt to different screen sizes
33
+ * - UI-driven camera transitions
6
34
  *
7
35
  * - [Example on needle.run](https://viewbox-demo-z23hmxbz2gkayo-z1nyzm6.needle.run/)
8
36
  * - [Scrollytelling Demo using animated Viewbox](https://scrollytelling-bike-z23hmxb2gnu5a.needle.run/)
9
37
  * - [Example on Stackblitz](https://stackblitz.com/edit/needle-engine-view-box-example)
10
38
  *
11
- * @example Add a Viewbox component to an object in your scene
39
+ * @example Basic setup - Add a ViewBox component to frame an object
40
+ * ```ts
41
+ * const viewBox = new Object3D();
42
+ * viewBox.position.set(0, 1, 0); // Position the viewbox center
43
+ * viewBox.scale.set(2, 2, 2); // Define the box size
44
+ * viewBox.addComponent(ViewBox, { debug: true });
45
+ * scene.add(viewBox);
46
+ * ```
47
+ *
48
+ * @example Animated ViewBox for zoom effects
49
+ * ```ts
50
+ * const viewBox = new Object3D();
51
+ * viewBox.addComponent(ViewBox, { mode: "continuous" });
52
+ * scene.add(viewBox);
53
+ *
54
+ * // Animate the viewbox scale over time
55
+ * function update() {
56
+ * const scale = 1 + Math.sin(Date.now() * 0.001) * 0.5;
57
+ * viewBox.scale.setScalar(scale);
58
+ * }
59
+ * ```
60
+ *
61
+ * @example One-time fitting with user control afterwards
12
62
  * ```ts
13
- const viewBox = new Object3D();
14
- viewBox.scale.set(0, 0, 0);
15
- viewBox.addComponent(ViewBox, { debug: true });
16
- scene.add(viewBox);
63
+ * const viewBox = new Object3D();
64
+ * viewBox.addComponent(ViewBox, {
65
+ * mode: "once", // Fit once, then allow free camera control
66
+ * referenceFieldOfView: 60
67
+ * });
68
+ * scene.add(viewBox);
17
69
  * ```
18
-
70
+ *
71
+ * @see {@link Camera} - The camera component that ViewBox controls
72
+ * @see {@link OrbitControls} - Camera controls that work alongside ViewBox
73
+ * @see {@link DragControls} - Alternative camera controls compatible with ViewBox
74
+ * @see {@link LookAtConstraint} - Another way to control camera targeting
75
+ * @see {@link SceneSwitcher} - Can be combined with ViewBox for scene transitions
76
+ * @see {@link Context.setCameraFocusRect} - The underlying focus rect API used by ViewBox
77
+ * @see {@link Context.focusRectSettings} - Manual control of focus rect settings
78
+ * @see {@link ViewBoxMode} - The mode type for controlling ViewBox behavior
79
+ *
19
80
  * @summary Automatically fits a box area into the camera view
20
81
  * @category Camera and Controls
21
82
  * @group Components
@@ -23,25 +84,64 @@ export type ViewBoxMode = "continuous" | "once";
23
84
  */
24
85
  export declare class ViewBox extends Behaviour {
25
86
  /**
26
- * All active ViewBox instances. The last one in the array is the currently active one.
87
+ * Array of all active ViewBox instances in the scene.
88
+ * When multiple ViewBoxes are enabled, the last one in the array (most recently enabled) takes priority and controls the camera.
89
+ * Other ViewBoxes remain registered but inactive, displayed with a dimmed gizmo color when debug visualization is enabled.
27
90
  */
28
91
  static readonly instances: ViewBox[];
29
92
  /**
30
- * The reference field of view is used to calculate the box size. This should usually be the same as your camera's fov.
31
- * @default -1 (meaning it will use the camera fov on the first frame)
93
+ * The reference field of view (in degrees) used to calculate how the box should fit within the camera view.
94
+ * This determines the baseline camera FOV for fitting calculations.
95
+ *
96
+ * **Behavior:**
97
+ * - If set to `-1` (default), the component will automatically use the camera's FOV on the first frame
98
+ * - Should typically match your camera's FOV for predictable framing
99
+ * - Can be set to a different value to create specific framing effects
100
+ *
101
+ * **Example:**
102
+ * If your camera has an FOV of 60° and you set `referenceFieldOfView` to 60, the ViewBox will fit objects
103
+ * as they would appear with that field of view. Setting it to a wider FOV (e.g., 90) makes objects appear
104
+ * smaller, while a narrower FOV (e.g., 30) makes them appear larger.
105
+ *
106
+ * @see {@link Camera} for the camera component and its FOV property
107
+ * @default -1 (automatically uses the camera's FOV on the first frame)
32
108
  */
33
109
  referenceFieldOfView: number;
34
110
  /**
35
- * The mode determines if the viewbox should be applied once or continuously while it is the active viewbox.
36
- * Options:
37
- * - "once": The viewbox will be applied once when it becomes the active viewbox. This is useful if you want to fit the view once and then allow the user to zoom or pan freely.
38
- * - "continuous": The viewbox will be applied continuously while it is the active viewbox. This is useful if you animate or scale the viewbox over time.
111
+ * Controls how the ViewBox applies camera adjustments.
112
+ *
113
+ * **Modes:**
114
+ * - `"once"`: Applies the framing adjustment once when the ViewBox becomes active, then stops updating.
115
+ * This is ideal when you want to frame the view initially but allow users to freely zoom, pan, or orbit afterwards.
116
+ * Perfect for interactive scenes where you want a good starting view but full user control.
117
+ *
118
+ * - `"continuous"`: Continuously updates the camera framing while this ViewBox is active.
119
+ * Use this when animating or scaling the ViewBox over time, or when you need the framing to constantly adjust.
120
+ * Great for cutscenes, scrollytelling, or any scenario with animated ViewBoxes.
121
+ *
122
+ * **Example Use Cases:**
123
+ * - Set to `"once"` for: Initial scene framing, product showcases where users explore freely after initial framing
124
+ * - Set to `"continuous"` for: Animated zoom effects, scrollytelling sequences, dynamic camera movements tied to ViewBox transforms
125
+ *
126
+ * @see {@link ViewBoxMode} for the type definition
127
+ * @default "continuous"
39
128
  */
40
129
  get mode(): ViewBoxMode;
41
130
  set mode(v: ViewBoxMode);
42
131
  private _mode;
43
132
  /**
44
- * Enable debug logs and rendering for this component instance
133
+ * Enables debug visualization and logging for this ViewBox instance.
134
+ *
135
+ * **When enabled, you will see:**
136
+ * - A yellow wireframe box showing the active ViewBox bounds in 3D space
137
+ * - Gray wireframe boxes for inactive ViewBox instances
138
+ * - A red dashed outline on screen showing the projected box in 2D (when using `?debugviewbox` URL parameter)
139
+ * - Console logs for mode changes, FOV settings, and camera adjustments
140
+ *
141
+ * **Tip:** You can also enable debug visualization globally for all ViewBoxes by adding `?debugviewbox` to your URL.
142
+ *
143
+ * @see {@link Gizmos} for the gizmo rendering system used for debug visualization
144
+ * @default false
45
145
  */
46
146
  debug: boolean;
47
147
  /** @internal */