@needle-tools/engine 4.13.0 → 4.13.1-beta
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.
- package/CHANGELOG.md +2 -1
- package/README.md +37 -0
- package/components.needle.json +1 -1
- package/custom-elements.json +138 -4
- package/dist/{needle-engine.bundle-CxaKFQVS.min.js → needle-engine.bundle-6774fXoY.min.js} +107 -107
- package/dist/{needle-engine.bundle-Dl3TFYyv.js → needle-engine.bundle-CGtsEhyJ.js} +2346 -1844
- package/dist/{needle-engine.bundle-J4k4znv8.umd.cjs → needle-engine.bundle-fbFZTOKP.umd.cjs} +108 -108
- package/dist/needle-engine.d.ts +3769 -397
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_context.d.ts +16 -0
- package/lib/engine/engine_context.js +16 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_gameobject.d.ts +72 -0
- package/lib/engine/engine_gameobject.js +38 -0
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_input.d.ts +80 -4
- package/lib/engine/engine_input.js +78 -2
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_math.d.ts +81 -2
- package/lib/engine/engine_math.js +68 -2
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_networking.d.ts +181 -14
- package/lib/engine/engine_networking.js +181 -14
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_networking_auto.d.ts +35 -8
- package/lib/engine/engine_networking_auto.js +35 -8
- package/lib/engine/engine_networking_auto.js.map +1 -1
- package/lib/engine/engine_physics.d.ts +35 -1
- package/lib/engine/engine_physics.js +35 -1
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +76 -0
- package/lib/engine/engine_physics_rapier.js +76 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_serialization_decorator.d.ts +28 -2
- package/lib/engine/engine_serialization_decorator.js +28 -2
- package/lib/engine/engine_serialization_decorator.js.map +1 -1
- package/lib/engine/engine_time.d.ts +23 -3
- package/lib/engine/engine_time.js +23 -3
- package/lib/engine/engine_time.js.map +1 -1
- package/lib/engine/engine_util_decorator.d.ts +31 -1
- package/lib/engine/engine_util_decorator.js +31 -1
- package/lib/engine/engine_util_decorator.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +21 -5
- package/lib/engine/engine_utils.js +21 -5
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_materialx.d.ts +2 -2
- package/lib/engine/extensions/NEEDLE_materialx.js +2 -2
- package/lib/engine/extensions/NEEDLE_materialx.js.map +1 -1
- package/lib/engine/extensions/index.d.ts +1 -1
- package/lib/engine/extensions/index.js +1 -1
- package/lib/engine/extensions/index.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +23 -3
- package/lib/engine-components/AlignmentConstraint.js +23 -3
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +42 -0
- package/lib/engine-components/Animation.js +36 -0
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +37 -4
- package/lib/engine-components/Animator.js +37 -4
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AudioListener.d.ts +1 -1
- package/lib/engine-components/AudioListener.js +1 -1
- package/lib/engine-components/AudioSource.d.ts +32 -10
- package/lib/engine-components/AudioSource.js +32 -10
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/AxesHelper.d.ts +22 -3
- package/lib/engine-components/AxesHelper.js +22 -3
- package/lib/engine-components/AxesHelper.js.map +1 -1
- package/lib/engine-components/BasicIKConstraint.d.ts +27 -4
- package/lib/engine-components/BasicIKConstraint.js +27 -4
- package/lib/engine-components/BasicIKConstraint.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +32 -2
- package/lib/engine-components/Camera.js +32 -2
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +68 -4
- package/lib/engine-components/CharacterController.js +68 -4
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +69 -12
- package/lib/engine-components/Collider.js +69 -12
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +26 -6
- package/lib/engine-components/ContactShadows.js +31 -8
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DeleteBox.d.ts +43 -2
- package/lib/engine-components/DeleteBox.js +43 -2
- package/lib/engine-components/DeleteBox.js.map +1 -1
- package/lib/engine-components/DeviceFlag.d.ts +21 -2
- package/lib/engine-components/DeviceFlag.js +21 -2
- package/lib/engine-components/DeviceFlag.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +32 -2
- package/lib/engine-components/DragControls.js +32 -2
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +33 -21
- package/lib/engine-components/DropListener.js +33 -21
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.d.ts +36 -5
- package/lib/engine-components/Duplicatable.js +36 -5
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/EventList.d.ts +38 -10
- package/lib/engine-components/EventList.js +38 -10
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/EventTrigger.d.ts +1 -1
- package/lib/engine-components/EventTrigger.js +1 -1
- package/lib/engine-components/Fog.d.ts +23 -1
- package/lib/engine-components/Fog.js +23 -1
- package/lib/engine-components/Fog.js.map +1 -1
- package/lib/engine-components/GridHelper.d.ts +18 -2
- package/lib/engine-components/GridHelper.js +18 -2
- package/lib/engine-components/GridHelper.js.map +1 -1
- package/lib/engine-components/GroundProjection.d.ts +24 -2
- package/lib/engine-components/GroundProjection.js +24 -2
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/Interactable.d.ts +17 -2
- package/lib/engine-components/Interactable.js +17 -2
- package/lib/engine-components/Interactable.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +50 -7
- package/lib/engine-components/Joints.js +50 -7
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LODGroup.d.ts +36 -14
- package/lib/engine-components/LODGroup.js +43 -11
- package/lib/engine-components/LODGroup.js.map +1 -1
- package/lib/engine-components/Light.d.ts +30 -5
- package/lib/engine-components/Light.js +30 -5
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +22 -7
- package/lib/engine-components/LookAtConstraint.js +22 -7
- package/lib/engine-components/LookAtConstraint.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +27 -5
- package/lib/engine-components/NeedleMenu.js +27 -5
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.d.ts +39 -4
- package/lib/engine-components/NestedGltf.js +42 -4
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/OffsetConstraint.d.ts +27 -3
- package/lib/engine-components/OffsetConstraint.js +27 -3
- package/lib/engine-components/OffsetConstraint.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +41 -3
- package/lib/engine-components/OrbitControls.js +41 -3
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/PlayerColor.d.ts +1 -1
- package/lib/engine-components/PlayerColor.js +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +17 -2
- package/lib/engine-components/ReflectionProbe.js +17 -3
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.d.ts +34 -0
- package/lib/engine-components/Renderer.js +35 -2
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.d.ts +11 -0
- package/lib/engine-components/SceneSwitcher.js +11 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/ScreenCapture.d.ts +38 -6
- package/lib/engine-components/ScreenCapture.js +38 -6
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/Skybox.d.ts +1 -1
- package/lib/engine-components/Skybox.js +1 -1
- package/lib/engine-components/SmoothFollow.d.ts +66 -7
- package/lib/engine-components/SmoothFollow.js +66 -7
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.d.ts +48 -1
- package/lib/engine-components/SpatialTrigger.js +48 -1
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +21 -3
- package/lib/engine-components/SpectatorCamera.js +21 -3
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SyncedRoom.d.ts +7 -1
- package/lib/engine-components/SyncedRoom.js +7 -1
- package/lib/engine-components/SyncedRoom.js.map +1 -1
- package/lib/engine-components/SyncedTransform.d.ts +55 -6
- package/lib/engine-components/SyncedTransform.js +55 -6
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/TransformGizmo.d.ts +30 -3
- package/lib/engine-components/TransformGizmo.js +30 -3
- package/lib/engine-components/TransformGizmo.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +33 -6
- package/lib/engine-components/VideoPlayer.js +45 -6
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +33 -2
- package/lib/engine-components/Voip.js +33 -2
- package/lib/engine-components/Voip.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +47 -13
- package/lib/engine-components/export/usdz/USDZExporter.js +47 -13
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +82 -3
- package/lib/engine-components/particlesystem/ParticleSystem.js +82 -3
- package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Antialiasing.d.ts +1 -0
- package/lib/engine-components/postprocessing/Effects/Antialiasing.js +1 -0
- package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -1
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +1 -1
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +1 -1
- package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js +1 -1
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.js +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +1 -1
- package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/Sharpening.js +1 -1
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js +1 -1
- package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/Vignette.js +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
- package/lib/engine-components/postprocessing/Volume.d.ts +1 -1
- package/lib/engine-components/postprocessing/Volume.js +1 -1
- package/lib/engine-components/splines/Spline.d.ts +409 -12
- package/lib/engine-components/splines/Spline.js +409 -12
- package/lib/engine-components/splines/Spline.js.map +1 -1
- package/lib/engine-components/splines/SplineUtils.d.ts +1 -0
- package/lib/engine-components/splines/SplineUtils.js +1 -0
- package/lib/engine-components/splines/SplineUtils.js.map +1 -1
- package/lib/engine-components/splines/SplineWalker.d.ts +3 -1
- package/lib/engine-components/splines/SplineWalker.js +3 -1
- package/lib/engine-components/splines/SplineWalker.js.map +1 -1
- package/lib/engine-components/timeline/PlayableDirector.d.ts +99 -14
- package/lib/engine-components/timeline/PlayableDirector.js +91 -25
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/ui/Button.d.ts +29 -3
- package/lib/engine-components/ui/Button.js +29 -3
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +29 -4
- package/lib/engine-components/ui/Canvas.js +29 -4
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
- package/lib/engine-components/ui/CanvasGroup.js +1 -1
- package/lib/engine-components/ui/EventSystem.d.ts +1 -1
- package/lib/engine-components/ui/EventSystem.js +1 -1
- package/lib/engine-components/ui/Graphic.d.ts +1 -0
- package/lib/engine-components/ui/Graphic.js +1 -0
- package/lib/engine-components/ui/Graphic.js.map +1 -1
- package/lib/engine-components/ui/Image.d.ts +22 -3
- package/lib/engine-components/ui/Image.js +22 -3
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/InputField.d.ts +1 -1
- package/lib/engine-components/ui/InputField.js +1 -1
- package/lib/engine-components/ui/Layout.d.ts +3 -0
- package/lib/engine-components/ui/Layout.js +3 -0
- package/lib/engine-components/ui/Layout.js.map +1 -1
- package/lib/engine-components/ui/Outline.d.ts +1 -1
- package/lib/engine-components/ui/Outline.js +1 -1
- package/lib/engine-components/ui/PointerEvents.d.ts +1 -1
- package/lib/engine-components/ui/PointerEvents.js +1 -1
- package/lib/engine-components/ui/Raycaster.d.ts +55 -6
- package/lib/engine-components/ui/Raycaster.js +55 -6
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/RectTransform.d.ts +1 -1
- package/lib/engine-components/ui/RectTransform.js +1 -1
- package/lib/engine-components/ui/SpatialHtml.d.ts +1 -1
- package/lib/engine-components/ui/SpatialHtml.js +1 -1
- package/lib/engine-components/ui/Text.d.ts +23 -1
- package/lib/engine-components/ui/Text.js +23 -1
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +1 -1
- package/lib/engine-components/utils/LookAt.js +1 -1
- package/lib/engine-components/utils/OpenURL.d.ts +1 -1
- package/lib/engine-components/utils/OpenURL.js +1 -1
- package/lib/engine-components/web/Clickthrough.d.ts +116 -7
- package/lib/engine-components/web/Clickthrough.js +116 -7
- package/lib/engine-components/web/Clickthrough.js.map +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +171 -7
- package/lib/engine-components/web/CursorFollow.js +171 -7
- package/lib/engine-components/web/CursorFollow.js.map +1 -1
- package/lib/engine-components/web/HoverAnimation.d.ts +140 -11
- package/lib/engine-components/web/HoverAnimation.js +140 -11
- package/lib/engine-components/web/HoverAnimation.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.d.ts +4 -1
- package/lib/engine-components/web/ScrollFollow.js +4 -1
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +116 -16
- package/lib/engine-components/web/ViewBox.js +110 -16
- package/lib/engine-components/web/ViewBox.js.map +1 -1
- package/lib/engine-components/webxr/TeleportTarget.d.ts +21 -2
- package/lib/engine-components/webxr/TeleportTarget.js +21 -2
- package/lib/engine-components/webxr/TeleportTarget.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +10 -2
- package/lib/engine-components/webxr/WebXR.js +10 -2
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components/webxr/WebXRAvatar.d.ts +39 -2
- package/lib/engine-components/webxr/WebXRAvatar.js +35 -3
- package/lib/engine-components/webxr/WebXRAvatar.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.d.ts +266 -30
- package/lib/engine-components/webxr/WebXRImageTracking.js +266 -30
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/lib/engine-components/webxr/WebXRPlaneTracking.d.ts +1 -1
- package/lib/engine-components/webxr/WebXRPlaneTracking.js +1 -1
- package/lib/engine-components/webxr/XRFlag.d.ts +29 -2
- package/lib/engine-components/webxr/XRFlag.js +29 -2
- package/lib/engine-components/webxr/XRFlag.js.map +1 -1
- package/package.json +1 -1
- package/plugins/vite/custom-element-data.js +128 -19
- package/src/engine/engine_context.ts +16 -0
- package/src/engine/engine_gameobject.ts +73 -0
- package/src/engine/engine_input.ts +83 -7
- package/src/engine/engine_math.ts +81 -2
- package/src/engine/engine_networking.ts +186 -17
- package/src/engine/engine_networking_auto.ts +36 -9
- package/src/engine/engine_physics.ts +37 -1
- package/src/engine/engine_physics_rapier.ts +77 -0
- package/src/engine/engine_serialization_decorator.ts +28 -2
- package/src/engine/engine_time.ts +23 -3
- package/src/engine/engine_util_decorator.ts +31 -1
- package/src/engine/engine_utils.ts +21 -5
- package/src/engine/extensions/NEEDLE_materialx.ts +5 -4
- package/src/engine/extensions/index.ts +2 -2
- package/src/engine-components/AlignmentConstraint.ts +24 -4
- package/src/engine-components/Animation.ts +44 -2
- package/src/engine-components/Animator.ts +40 -7
- package/src/engine-components/AudioListener.ts +1 -1
- package/src/engine-components/AudioSource.ts +37 -15
- package/src/engine-components/AxesHelper.ts +23 -4
- package/src/engine-components/BasicIKConstraint.ts +28 -5
- package/src/engine-components/Camera.ts +33 -3
- package/src/engine-components/CharacterController.ts +74 -7
- package/src/engine-components/Collider.ts +78 -21
- package/src/engine-components/ContactShadows.ts +36 -11
- package/src/engine-components/DeleteBox.ts +43 -2
- package/src/engine-components/DeviceFlag.ts +22 -3
- package/src/engine-components/DragControls.ts +32 -2
- package/src/engine-components/DropListener.ts +41 -29
- package/src/engine-components/Duplicatable.ts +37 -6
- package/src/engine-components/EventList.ts +41 -13
- package/src/engine-components/EventTrigger.ts +1 -1
- package/src/engine-components/Fog.ts +23 -1
- package/src/engine-components/GridHelper.ts +18 -2
- package/src/engine-components/GroundProjection.ts +25 -3
- package/src/engine-components/Interactable.ts +17 -2
- package/src/engine-components/Joints.ts +51 -8
- package/src/engine-components/LODGroup.ts +45 -11
- package/src/engine-components/Light.ts +35 -13
- package/src/engine-components/LookAtConstraint.ts +26 -8
- package/src/engine-components/NeedleMenu.ts +29 -7
- package/src/engine-components/NestedGltf.ts +40 -4
- package/src/engine-components/OffsetConstraint.ts +27 -3
- package/src/engine-components/OrbitControls.ts +41 -3
- package/src/engine-components/PlayerColor.ts +1 -1
- package/src/engine-components/ReflectionProbe.ts +19 -5
- package/src/engine-components/Renderer.ts +34 -1
- package/src/engine-components/SceneSwitcher.ts +11 -0
- package/src/engine-components/ScreenCapture.ts +41 -9
- package/src/engine-components/Skybox.ts +1 -1
- package/src/engine-components/SmoothFollow.ts +68 -7
- package/src/engine-components/SpatialTrigger.ts +51 -4
- package/src/engine-components/SpectatorCamera.ts +23 -5
- package/src/engine-components/SyncedRoom.ts +8 -2
- package/src/engine-components/SyncedTransform.ts +59 -10
- package/src/engine-components/TransformGizmo.ts +31 -4
- package/src/engine-components/VideoPlayer.ts +48 -6
- package/src/engine-components/Voip.ts +33 -2
- package/src/engine-components/export/usdz/USDZExporter.ts +47 -13
- package/src/engine-components/particlesystem/ParticleSystem.ts +84 -5
- package/src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -0
- package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -1
- package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +1 -1
- package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +1 -1
- package/src/engine-components/postprocessing/Effects/DepthOfField.ts +1 -1
- package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
- package/src/engine-components/postprocessing/Effects/Pixelation.ts +1 -1
- package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +1 -1
- package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +1 -1
- package/src/engine-components/postprocessing/Effects/Sharpening.ts +1 -1
- package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +1 -1
- package/src/engine-components/postprocessing/Effects/Tonemapping.ts +1 -1
- package/src/engine-components/postprocessing/Effects/Vignette.ts +1 -1
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
- package/src/engine-components/postprocessing/Volume.ts +1 -1
- package/src/engine-components/splines/Spline.ts +412 -14
- package/src/engine-components/splines/SplineUtils.ts +1 -0
- package/src/engine-components/splines/SplineWalker.ts +4 -2
- package/src/engine-components/timeline/PlayableDirector.ts +104 -27
- package/src/engine-components/ui/Button.ts +29 -3
- package/src/engine-components/ui/Canvas.ts +29 -4
- package/src/engine-components/ui/CanvasGroup.ts +2 -2
- package/src/engine-components/ui/EventSystem.ts +1 -1
- package/src/engine-components/ui/Graphic.ts +1 -0
- package/src/engine-components/ui/Image.ts +22 -3
- package/src/engine-components/ui/InputField.ts +2 -2
- package/src/engine-components/ui/Layout.ts +3 -0
- package/src/engine-components/ui/Outline.ts +1 -1
- package/src/engine-components/ui/PointerEvents.ts +1 -1
- package/src/engine-components/ui/Raycaster.ts +57 -8
- package/src/engine-components/ui/RectTransform.ts +2 -2
- package/src/engine-components/ui/SpatialHtml.ts +1 -1
- package/src/engine-components/ui/Text.ts +24 -2
- package/src/engine-components/utils/LookAt.ts +1 -1
- package/src/engine-components/utils/OpenURL.ts +1 -1
- package/src/engine-components/web/Clickthrough.ts +119 -10
- package/src/engine-components/web/CursorFollow.ts +174 -9
- package/src/engine-components/web/HoverAnimation.ts +142 -13
- package/src/engine-components/web/ScrollFollow.ts +4 -1
- package/src/engine-components/web/ViewBox.ts +118 -18
- package/src/engine-components/webxr/TeleportTarget.ts +23 -4
- package/src/engine-components/webxr/WebXR.ts +11 -3
- package/src/engine-components/webxr/WebXRAvatar.ts +41 -4
- package/src/engine-components/webxr/WebXRImageTracking.ts +282 -38
- package/src/engine-components/webxr/WebXRPlaneTracking.ts +1 -1
- package/src/engine-components/webxr/XRFlag.ts +30 -3
|
@@ -17,20 +17,15 @@ import * as Tracks from "./TimelineTracks.js";
|
|
|
17
17
|
const debug = getParam("debugtimeline");
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Controls how the {@link PlayableDirector} behaves when playback reaches the end.
|
|
21
|
+
* @see {@link PlayableDirector.extrapolationMode}
|
|
21
22
|
*/
|
|
22
23
|
export enum DirectorWrapMode {
|
|
23
|
-
|
|
24
|
-
/// <para>Hold the last frame when the playable time reaches it's duration.</para>
|
|
25
|
-
/// </summary>
|
|
24
|
+
/** Hold the last frame when playback reaches the end of the timeline. */
|
|
26
25
|
Hold = 0,
|
|
27
|
-
|
|
28
|
-
/// <para>Loop back to zero time and continue playing.</para>
|
|
29
|
-
/// </summary>
|
|
26
|
+
/** Loop back to the start and continue playing indefinitely. */
|
|
30
27
|
Loop = 1,
|
|
31
|
-
|
|
32
|
-
/// <para>Do not keep playing when the time reaches the duration.</para>
|
|
33
|
-
/// </summary>
|
|
28
|
+
/** Stop playback when the end is reached. The timeline will not loop. */
|
|
34
29
|
None = 2,
|
|
35
30
|
}
|
|
36
31
|
|
|
@@ -53,26 +48,76 @@ export enum ClipExtrapolation {
|
|
|
53
48
|
export type CreateTrackFunction = (director: PlayableDirector, track: Models.TrackModel) => Tracks.TrackHandler | undefined | null;
|
|
54
49
|
|
|
55
50
|
/**
|
|
56
|
-
*
|
|
57
|
-
* It
|
|
58
|
-
*
|
|
51
|
+
* PlayableDirector is the main component for controlling timelines in Needle Engine.
|
|
52
|
+
* It orchestrates playback of TimelineAssets containing animation, audio, signal,
|
|
53
|
+
* control, and activation tracks.
|
|
54
|
+
*
|
|
55
|
+
* **Supported track types:**
|
|
56
|
+
* - Animation tracks - animate objects using AnimationClips
|
|
57
|
+
* - Audio tracks - play synchronized audio
|
|
58
|
+
* - Activation tracks - show/hide objects at specific times
|
|
59
|
+
* - Signal tracks - trigger events at specific points
|
|
60
|
+
* - Control tracks - control nested timelines or prefab instances
|
|
61
|
+
* - Marker tracks - add metadata and navigation points
|
|
62
|
+
*
|
|
63
|
+
* [](https://engine.needle.tools/samples/bike-scrollytelling-responsive-3d)
|
|
64
|
+
*
|
|
65
|
+
* [](https://app.songsofcultures.com/?scene=little-brother)
|
|
66
|
+
*
|
|
67
|
+
* **Playback control:**
|
|
68
|
+
* Use `play()`, `pause()`, `stop()` for basic control.
|
|
69
|
+
* Set `time` directly and call `evaluate()` for scrubbing.
|
|
70
|
+
* Adjust `speed` for playback rate and `weight` for blending.
|
|
71
|
+
*
|
|
72
|
+
* @example Basic timeline playback
|
|
73
|
+
* ```ts
|
|
74
|
+
* const director = myObject.getComponent(PlayableDirector);
|
|
75
|
+
* director.play();
|
|
76
|
+
* // Jump to specific time
|
|
77
|
+
* director.time = 2.5;
|
|
78
|
+
* director.evaluate();
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @example Control playback speed
|
|
82
|
+
* ```ts
|
|
83
|
+
* director.speed = 0.5; // Half speed
|
|
84
|
+
* director.speed = -1; // Reverse playback
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* - Example: https://engine.needle.tools/samples-uploads/product-flyover/
|
|
88
|
+
*
|
|
59
89
|
* @summary Controls and plays TimelineAssets
|
|
60
90
|
* @category Animation and Sequencing
|
|
61
91
|
* @group Components
|
|
92
|
+
* @see {@link Animator} for playing individual AnimationClips
|
|
93
|
+
* @see {@link AudioSource} for standalone audio playback
|
|
94
|
+
* @see {@link SignalReceiver} for handling timeline signals
|
|
95
|
+
* @link https://engine.needle.tools/samples/?overlay=samples&tag=animation
|
|
96
|
+
* @link https://app.songsofcultures.com/
|
|
62
97
|
*/
|
|
63
98
|
export class PlayableDirector extends Behaviour {
|
|
64
99
|
|
|
65
100
|
private static createTrackFunctions: { [key: string]: CreateTrackFunction } = {};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Register a function to create a track handler for a custom track type.
|
|
104
|
+
* This allows you to extend the timeline system with your own track types and handlers.
|
|
105
|
+
*/
|
|
66
106
|
static registerCreateTrack(type: string, fn: CreateTrackFunction) {
|
|
67
107
|
this.createTrackFunctions[type] = fn;
|
|
68
108
|
}
|
|
69
109
|
|
|
70
110
|
/**
|
|
71
|
-
* The timeline asset
|
|
111
|
+
* The timeline asset containing tracks, clips, and markers that this director will play.
|
|
112
|
+
* Assign a timeline asset exported from Unity or Blender to enable playback.
|
|
72
113
|
*/
|
|
73
114
|
playableAsset?: Models.TimelineAssetModel;
|
|
74
115
|
|
|
75
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* When true, the timeline starts playing automatically when the component awakens.
|
|
118
|
+
* Set to false to control playback manually via `play()`.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
76
121
|
@serializable()
|
|
77
122
|
playOnAwake?: boolean;
|
|
78
123
|
|
|
@@ -83,11 +128,18 @@ export class PlayableDirector extends Behaviour {
|
|
|
83
128
|
@serializable()
|
|
84
129
|
extrapolationMode: DirectorWrapMode = DirectorWrapMode.Loop;
|
|
85
130
|
|
|
86
|
-
/**
|
|
131
|
+
/** Returns true if the timeline is currently playing (not paused or stopped). */
|
|
87
132
|
get isPlaying(): boolean { return this._isPlaying; }
|
|
88
|
-
/**
|
|
133
|
+
/** Returns true if the timeline is currently paused. */
|
|
89
134
|
get isPaused(): boolean { return this._isPaused; }
|
|
90
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* The current playback time in seconds. Set this and call `evaluate()` to scrub.
|
|
137
|
+
* @example Scrub to a specific time
|
|
138
|
+
* ```ts
|
|
139
|
+
* director.time = 5.0;
|
|
140
|
+
* director.evaluate();
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
91
143
|
get time(): number { return this._time; }
|
|
92
144
|
set time(value: number) {
|
|
93
145
|
if (typeof value === "number" && !Number.isNaN(value))
|
|
@@ -96,17 +148,32 @@ export class PlayableDirector extends Behaviour {
|
|
|
96
148
|
console.error("INVALID TIMELINE.TIME VALUE", value, this.name)
|
|
97
149
|
};
|
|
98
150
|
}
|
|
99
|
-
/**
|
|
151
|
+
/** The total duration of the timeline in seconds (read from the longest track/clip). */
|
|
100
152
|
get duration(): number { return this._duration; }
|
|
101
153
|
set duration(value: number) { this._duration = value; }
|
|
102
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* The blend weight of the timeline (0-1). Use values below 1 to blend
|
|
156
|
+
* timeline animations with other animations like those from an Animator.
|
|
157
|
+
*/
|
|
103
158
|
get weight(): number { return this._weight; };
|
|
104
159
|
set weight(value: number) { this._weight = value; }
|
|
105
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* The playback speed multiplier. Set to negative values for reverse playback.
|
|
162
|
+
* @example Reverse playback at double speed
|
|
163
|
+
* ```ts
|
|
164
|
+
* director.speed = -2;
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
106
167
|
get speed(): number { return this._speed; }
|
|
107
168
|
set speed(value: number) { this._speed = value; }
|
|
108
169
|
|
|
109
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* When true, `play()` will wait for audio tracks to load and for user interaction
|
|
172
|
+
* before starting playback. Web browsers require user interaction (click/tap) before
|
|
173
|
+
* allowing audio to play - this ensures audio is synchronized with the timeline.
|
|
174
|
+
* Set to false if you need immediate visual playback and can tolerate audio delay.
|
|
175
|
+
* @default true
|
|
176
|
+
*/
|
|
110
177
|
waitForAudio: boolean = true;
|
|
111
178
|
|
|
112
179
|
private _visibilityChangeEvt?: any;
|
|
@@ -223,9 +290,9 @@ export class PlayableDirector extends Behaviour {
|
|
|
223
290
|
await delay(200);
|
|
224
291
|
}
|
|
225
292
|
this.invokeStateChangedMethodsOnTracks();
|
|
226
|
-
// Update timeline in LateUpdate to give other scripts time to react to the updated state
|
|
227
|
-
// e.g. if we animate OrbitControls look at target we want those changes to be applied in onBeforeRender
|
|
228
|
-
// if we use onBeforeRender here it will be called *after* the regular onBeforeRender events
|
|
293
|
+
// Update timeline in LateUpdate to give other scripts time to react to the updated state
|
|
294
|
+
// e.g. if we animate OrbitControls look at target we want those changes to be applied in onBeforeRender
|
|
295
|
+
// if we use onBeforeRender here it will be called *after* the regular onBeforeRender events
|
|
229
296
|
// which is too late
|
|
230
297
|
this._internalUpdateRoutine = this.startCoroutine(this.internalUpdate(), FrameEvent.LateUpdate);
|
|
231
298
|
}
|
|
@@ -762,8 +829,18 @@ export class PlayableDirector extends Behaviour {
|
|
|
762
829
|
}
|
|
763
830
|
}
|
|
764
831
|
|
|
765
|
-
/**
|
|
766
|
-
*
|
|
832
|
+
/**
|
|
833
|
+
* Interface for receiving callbacks during timeline animation evaluation.
|
|
834
|
+
* Allows modification of position/rotation values before they are applied.
|
|
835
|
+
*
|
|
836
|
+
* **Registration:**
|
|
837
|
+
* ```ts
|
|
838
|
+
* director.registerAnimationCallback(this);
|
|
839
|
+
* // Later: director.unregisterAnimationCallback(this);
|
|
840
|
+
* ```
|
|
841
|
+
*
|
|
842
|
+
* @experimental This interface may change in future versions
|
|
843
|
+
* @see {@link PlayableDirector.registerAnimationCallback}
|
|
767
844
|
*/
|
|
768
845
|
export interface ITimelineAnimationCallbacks {
|
|
769
846
|
/**
|
|
@@ -61,12 +61,38 @@ class AnimationTriggers {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Button is a UI component that can be clicked
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* [Button](https://engine.needle.tools/docs/api/Button) is a UI component that can be clicked to trigger actions.
|
|
65
|
+
* Supports visual states (normal, highlighted, pressed, disabled) with
|
|
66
|
+
* color tints or animation transitions.
|
|
67
|
+
*
|
|
68
|
+
* **Visual transitions:**
|
|
69
|
+
* - `ColorTint` - Tint the button image with state colors
|
|
70
|
+
* - `Animation` - Trigger animator states for each button state
|
|
71
|
+
* - `SpriteSwap` - Swap sprites for each state (not fully supported)
|
|
72
|
+
*
|
|
73
|
+
* **Requirements:**
|
|
74
|
+
* - Typically paired with an {@link Image} component for visuals or any 3D object
|
|
75
|
+
*
|
|
76
|
+
* @example Listen to button clicks
|
|
77
|
+
* ```ts
|
|
78
|
+
* const button = myButton.getComponent(Button);
|
|
79
|
+
* button.onClick.addEventListener(() => {
|
|
80
|
+
* console.log("Button clicked!");
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @example Programmatically click a button
|
|
85
|
+
* ```ts
|
|
86
|
+
* button.click(); // Triggers onClick event
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
67
89
|
* @summary UI Button that can be clicked to perform actions
|
|
68
90
|
* @category User Interface
|
|
69
91
|
* @group Components
|
|
92
|
+
* @see {@link EventList} for onClick callback handling
|
|
93
|
+
* @see {@link Image} for button visuals
|
|
94
|
+
* @see {@link GraphicRaycaster} for UI interaction
|
|
95
|
+
* @see {@link Transition} for visual state options
|
|
70
96
|
*/
|
|
71
97
|
export class Button extends Behaviour implements IPointerEventHandler {
|
|
72
98
|
|
|
@@ -25,13 +25,38 @@ export enum RenderMode {
|
|
|
25
25
|
const debugLayout = getParam("debuguilayout");
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Canvas is the root component for all UI elements in a scene.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* [Canvas](https://engine.needle.tools/docs/api/Canvas) is the root component for all UI elements in a scene.
|
|
29
|
+
* Defines the rendering area and manages layout for child UI elements.
|
|
30
|
+
*
|
|
31
|
+
* **Render modes:**
|
|
32
|
+
* - `WorldSpace` - UI exists in 3D space, can be viewed from any angle
|
|
33
|
+
* - `ScreenSpaceOverlay` - UI rendered on top of everything (HUD)
|
|
34
|
+
* - `ScreenSpaceCamera` - UI rendered at a distance from a specific camera
|
|
35
|
+
*
|
|
36
|
+
* **Usage:**
|
|
37
|
+
* All UI components ({@link Button}, {@link Text}, {@link Image}) must be
|
|
38
|
+
* children of a Canvas to render correctly. Multiple canvases can exist
|
|
39
|
+
* in a scene with different settings.
|
|
40
|
+
*
|
|
41
|
+
* **Rendering options:**
|
|
42
|
+
* - `renderOnTop` - Always render above other objects
|
|
43
|
+
* - `depthWrite` - Write to depth buffer (affects occlusion)
|
|
44
|
+
* - `doubleSided` - Render both sides of UI elements
|
|
45
|
+
*
|
|
46
|
+
* @example Create a world-space UI panel
|
|
47
|
+
* ```ts
|
|
48
|
+
* const canvas = panel.getComponent(Canvas);
|
|
49
|
+
* canvas.renderMode = RenderMode.WorldSpace;
|
|
50
|
+
* canvas.doubleSided = true;
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
32
53
|
* @summary Root component for UI elements, managing layout and rendering settings
|
|
33
54
|
* @category User Interface
|
|
34
55
|
* @group Components
|
|
56
|
+
* @see {@link RenderMode} for rendering options
|
|
57
|
+
* @see {@link RectTransform} for UI layout
|
|
58
|
+
* @see {@link Button} for clickable UI elements
|
|
59
|
+
* @see {@link Text} for UI text rendering
|
|
35
60
|
*/
|
|
36
61
|
export class Canvas extends UIRootComponent implements ICanvas {
|
|
37
62
|
|
|
@@ -7,8 +7,8 @@ import { type ICanvasGroup, type IHasAlphaFactor } from "./Interfaces.js";
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* CanvasGroup is a UI component that allows you to control the transparency and interactivity of a group of UI elements.
|
|
11
|
-
* By adjusting the alpha property, you can fade in or out all child UI elements simultaneously.
|
|
10
|
+
* [CanvasGroup](https://engine.needle.tools/docs/api/CanvasGroup) is a UI component that allows you to control the transparency and interactivity of a group of UI elements.
|
|
11
|
+
* By adjusting the alpha property, you can fade in or out all child UI elements simultaneously.
|
|
12
12
|
* The interactable and blocksRaycasts properties let you enable or disable user interaction for the entire group.
|
|
13
13
|
* @summary Group UI elements to control transparency and interactivity
|
|
14
14
|
* @category User Interface
|
|
@@ -36,7 +36,7 @@ onInitialized((ctx) => {
|
|
|
36
36
|
})
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* [EventSystem](https://engine.needle.tools/docs/api/EventSystem) is responsible for managing and dispatching input events to UI components within the scene.
|
|
40
40
|
* @summary Manages and dispatches input events to UI components
|
|
41
41
|
* @category User Interface
|
|
42
42
|
* @group Components
|
|
@@ -22,6 +22,7 @@ const _colorStateObject: { backgroundColor: Color, backgroundOpacity: number, bo
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
+
* [Graphic](https://engine.needle.tools/docs/api/Graphic) provides basic rendering for UI elements with color, opacity, and texture support.
|
|
25
26
|
* @category User Interface
|
|
26
27
|
* @group Components
|
|
27
28
|
*/
|
|
@@ -12,12 +12,31 @@ class Sprite {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Image
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* [Image](https://engine.needle.tools/docs/api/Image) displays a sprite (2D texture) in the UI. Can be used for icons,
|
|
16
|
+
* backgrounds, or any visual element that needs a texture.
|
|
17
|
+
*
|
|
18
|
+
* **Properties:**
|
|
19
|
+
* - `image` - Direct texture assignment (convenience property)
|
|
20
|
+
* - `sprite` - Sprite object containing texture and rect info
|
|
21
|
+
* - `color` - Tint color applied to the image (inherited from Graphic)
|
|
22
|
+
*
|
|
23
|
+
* **Usage with Button:**
|
|
24
|
+
* Image is commonly paired with {@link Button} to create clickable
|
|
25
|
+
* UI elements with visual feedback via color tinting.
|
|
26
|
+
*
|
|
27
|
+
* @example Set an image texture
|
|
28
|
+
* ```ts
|
|
29
|
+
* const img = myIcon.getComponent(Image);
|
|
30
|
+
* img.image = myTexture;
|
|
31
|
+
* img.color = new RGBAColor(1, 0.5, 0.5, 1); // Red tint
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
18
34
|
* @summary Display a 2D image in the UI
|
|
19
35
|
* @category User Interface
|
|
20
36
|
* @group Components
|
|
37
|
+
* @see {@link Canvas} for the UI root
|
|
38
|
+
* @see {@link Button} for clickable images
|
|
39
|
+
* @see {@link RawImage} for non-UI image display
|
|
21
40
|
*/
|
|
22
41
|
export class Image extends MaskableGraphic {
|
|
23
42
|
|
|
@@ -10,8 +10,8 @@ import { tryGetUIComponent } from "./Utils.js";
|
|
|
10
10
|
const debug = getParam("debuginputfield");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* InputField is a UI component that allows users to enter and edit text.
|
|
14
|
-
* It provides a text input area where users can type, delete, and modify text.
|
|
13
|
+
* [InputField](https://engine.needle.tools/docs/api/InputField) is a UI component that allows users to enter and edit text.
|
|
14
|
+
* It provides a text input area where users can type, delete, and modify text.
|
|
15
15
|
* The InputField supports placeholder text, events for value changes, and end edit actions.
|
|
16
16
|
* @summary Text field for user input
|
|
17
17
|
* @category User Interface
|
|
@@ -301,6 +301,7 @@ export abstract class HorizontalOrVerticalLayoutGroup extends LayoutGroup {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
|
+
* [VerticalLayoutGroup](https://engine.needle.tools/docs/api/VerticalLayoutGroup) arranges child UI elements vertically with spacing, padding, and alignment options.
|
|
304
305
|
* @category User Interface
|
|
305
306
|
* @group Components
|
|
306
307
|
*/
|
|
@@ -313,6 +314,7 @@ export class VerticalLayoutGroup extends HorizontalOrVerticalLayoutGroup {
|
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
/**
|
|
317
|
+
* [HorizontalLayoutGroup](https://engine.needle.tools/docs/api/HorizontalLayoutGroup) arranges child UI elements horizontally with spacing, padding, and alignment options.
|
|
316
318
|
* @category User Interface
|
|
317
319
|
* @group Components
|
|
318
320
|
*/
|
|
@@ -325,6 +327,7 @@ export class HorizontalLayoutGroup extends HorizontalOrVerticalLayoutGroup {
|
|
|
325
327
|
}
|
|
326
328
|
|
|
327
329
|
/**
|
|
330
|
+
* [GridLayoutGroup](https://engine.needle.tools/docs/api/GridLayoutGroup) arranges child UI elements in a grid pattern.
|
|
328
331
|
* @category User Interface
|
|
329
332
|
* @group Components
|
|
330
333
|
*/
|
|
@@ -5,7 +5,7 @@ import { RGBAColor } from "../../engine/js-extensions/index.js";
|
|
|
5
5
|
import { Behaviour } from "../Component.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Outline is a UI component that adds an outline effect to UI elements.
|
|
8
|
+
* [Outline](https://engine.needle.tools/docs/api/Outline) is a UI component that adds an outline effect to UI elements.
|
|
9
9
|
* You can customize the outline color and distance to create a visual border around the UI element.
|
|
10
10
|
* @summary Add an outline effect to UI elements
|
|
11
11
|
* @category User Interface
|
|
@@ -10,7 +10,7 @@ export interface IInputEventArgs {
|
|
|
10
10
|
stopImmediatePropagation?(): void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
/** This pointer event data object is passed to all event receivers that are currently active
|
|
13
|
+
/** [PointerEventData](https://engine.needle.tools/docs/api/PointerEventData) This pointer event data object is passed to all event receivers that are currently active
|
|
14
14
|
* It contains hit information if an object was hovered or clicked
|
|
15
15
|
* If the event is received in onPointerDown or onPointerMove, you can call `setPointerCapture` to receive onPointerMove events even when the pointer has left the object until you call `releasePointerCapture` or when the pointerUp event happens
|
|
16
16
|
* You can get additional information about the event or event source via the `event` property (of type `NEPointerEvent`)
|
|
@@ -7,9 +7,21 @@ import { Behaviour } from "../Component.js";
|
|
|
7
7
|
import { EventSystem } from "./EventSystem.js";
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
/**
|
|
11
|
+
* [ObjectRaycaster](https://engine.needle.tools/docs/api/ObjectRaycaster) Base class for raycasters that detect pointer interactions.
|
|
12
|
+
* Derive from this class to create custom raycasting logic.
|
|
13
|
+
*
|
|
14
|
+
* **Built-in raycasters:**
|
|
15
|
+
* - {@link ObjectRaycaster} - Raycasts against 3D objects
|
|
16
|
+
* - {@link GraphicRaycaster} - Raycasts against UI elements
|
|
17
|
+
* - {@link SpatialGrabRaycaster} - Sphere overlap for XR grab
|
|
18
|
+
*
|
|
19
|
+
* **Important:** If you override `awake`, `onEnable`, or `onDisable`,
|
|
20
|
+
* call the base class methods to ensure proper registration with {@link EventSystem}.
|
|
21
|
+
*
|
|
22
|
+
* @category Interactivity
|
|
23
|
+
* @group Components
|
|
24
|
+
* @see {@link EventSystem} for the event dispatch system
|
|
13
25
|
*/
|
|
14
26
|
export abstract class Raycaster extends Behaviour {
|
|
15
27
|
awake(): void {
|
|
@@ -29,10 +41,22 @@ export abstract class Raycaster extends Behaviour {
|
|
|
29
41
|
|
|
30
42
|
|
|
31
43
|
/**
|
|
32
|
-
*
|
|
44
|
+
* ObjectRaycaster enables pointer interactions with 3D objects.
|
|
45
|
+
* Add this component to any object that needs click/hover detection.
|
|
46
|
+
*
|
|
47
|
+
* **Usage:**
|
|
48
|
+
* Objects with ObjectRaycaster will receive pointer events when
|
|
49
|
+
* they implement interfaces like {@link IPointerClickHandler}.
|
|
33
50
|
*
|
|
51
|
+
* **Note:**
|
|
52
|
+
* In older Needle Engine versions the ObjectRaycaster was required to be added to the Scene.
|
|
53
|
+
* This is no longer the case - the EventSystem will automatically handle raycasts.
|
|
54
|
+
*
|
|
55
|
+
*
|
|
34
56
|
* @category Interactivity
|
|
35
57
|
* @group Components
|
|
58
|
+
* @see {@link IPointerClickHandler} for click events
|
|
59
|
+
* @see {@link DragControls} for drag interactions
|
|
36
60
|
*/
|
|
37
61
|
export class ObjectRaycaster extends Raycaster {
|
|
38
62
|
private targets: Object3D[] | null = null;
|
|
@@ -73,11 +97,27 @@ export class ObjectRaycaster extends Raycaster {
|
|
|
73
97
|
|
|
74
98
|
|
|
75
99
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
100
|
+
* GraphicRaycaster enables pointer interactions with UI elements.
|
|
101
|
+
* Add this to a {@link Canvas} or UI hierarchy to enable button clicks,
|
|
102
|
+
* hover effects, and other UI interactions.
|
|
103
|
+
*
|
|
104
|
+
* **Requirements:**
|
|
105
|
+
* - Must be on the same object as a Canvas or on a parent
|
|
106
|
+
* - UI elements need proper RectTransform setup
|
|
107
|
+
*
|
|
108
|
+
* @example Enable UI interaction
|
|
109
|
+
* ```ts
|
|
110
|
+
* // Add to Canvas object
|
|
111
|
+
* canvas.addComponent(GraphicRaycaster);
|
|
112
|
+
* // Now buttons and other UI elements will respond to clicks
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
78
115
|
* @summary Raycaster for UI elements
|
|
79
116
|
* @category User Interface
|
|
80
117
|
* @group Components
|
|
118
|
+
* @see {@link Canvas} for UI root
|
|
119
|
+
* @see {@link Button} for clickable UI
|
|
120
|
+
* @see {@link EventSystem} for event handling
|
|
81
121
|
*/
|
|
82
122
|
export class GraphicRaycaster extends ObjectRaycaster {
|
|
83
123
|
// eventCamera: Camera | null = null;
|
|
@@ -91,10 +131,19 @@ export class GraphicRaycaster extends ObjectRaycaster {
|
|
|
91
131
|
}
|
|
92
132
|
|
|
93
133
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
134
|
+
* SpatialGrabRaycaster enables direct grab interactions in VR/AR.
|
|
135
|
+
* Uses sphere overlap detection around the controller/hand position
|
|
136
|
+
* to allow grabbing objects by reaching into them.
|
|
137
|
+
*
|
|
138
|
+
* **Features:**
|
|
139
|
+
* - Active only during XR sessions
|
|
140
|
+
* - Can be globally disabled via `SpatialGrabRaycaster.allow`
|
|
141
|
+
* - Works alongside ray-based interaction
|
|
142
|
+
*
|
|
96
143
|
* @category XR
|
|
97
144
|
* @group Components
|
|
145
|
+
* @see {@link WebXR} for XR session management
|
|
146
|
+
* @see {@link DragControls} for object manipulation
|
|
98
147
|
*/
|
|
99
148
|
export class SpatialGrabRaycaster extends Raycaster {
|
|
100
149
|
|
|
@@ -29,8 +29,8 @@ const tempVec = new Vector3();
|
|
|
29
29
|
const tempMatrix = new Matrix4();
|
|
30
30
|
const tempQuaternion = new Quaternion();
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* RectTransform
|
|
32
|
+
/**
|
|
33
|
+
* [RectTransform](https://engine.needle.tools/docs/api/RectTransform) defines a rectangle for UI layout with anchoring, pivoting, and positioning capabilities.
|
|
34
34
|
* @summary UI Rectangle Transform
|
|
35
35
|
* @category User Interface
|
|
36
36
|
* @group Components
|
|
@@ -7,7 +7,7 @@ import { getWorldRotation, setWorldRotationXYZ } from '../../engine/engine_three
|
|
|
7
7
|
import { Behaviour } from '../Component.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* SpatialHtml is a component that allows you to integrate HTML elements into a 3D scene.
|
|
10
|
+
* [SpatialHtml](https://engine.needle.tools/docs/api/SpatialHtml) is a component that allows you to integrate HTML elements into a 3D scene.
|
|
11
11
|
* By specifying the ID of an existing HTML element, you can render it as a 3D object within the scene.
|
|
12
12
|
* @summary Render HTML elements as 3D objects in the scene
|
|
13
13
|
* @category User Interface
|
|
@@ -40,11 +40,33 @@ export enum FontStyle {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Text
|
|
44
|
-
*
|
|
43
|
+
* [Text](https://engine.needle.tools/docs/api/Text) displays text content in the UI. Supports custom fonts, colors,
|
|
44
|
+
* alignment, and basic rich text formatting.
|
|
45
|
+
*
|
|
46
|
+
* **Text properties:**
|
|
47
|
+
* - `text` - The string content to display
|
|
48
|
+
* - `fontSize` - Size of the text in pixels
|
|
49
|
+
* - `color` - Text color (inherited from Graphic)
|
|
50
|
+
* - `alignment` - Text anchor position (UpperLeft, MiddleCenter, etc.)
|
|
51
|
+
*
|
|
52
|
+
* **Fonts:**
|
|
53
|
+
* Set the `font` property to a URL pointing to a font file.
|
|
54
|
+
* Supports MSDF (Multi-channel Signed Distance Field) fonts for crisp rendering.
|
|
55
|
+
*
|
|
56
|
+
* @example Update text at runtime
|
|
57
|
+
* ```ts
|
|
58
|
+
* const text = myLabel.getComponent(Text);
|
|
59
|
+
* text.text = "Score: " + score;
|
|
60
|
+
* text.fontSize = 24;
|
|
61
|
+
* text.color = new RGBAColor(1, 1, 1, 1);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
45
64
|
* @summary Display text in the UI
|
|
46
65
|
* @category User Interface
|
|
47
66
|
* @group Components
|
|
67
|
+
* @see {@link Canvas} for the UI root
|
|
68
|
+
* @see {@link TextAnchor} for alignment options
|
|
69
|
+
* @see {@link FontStyle} for bold/italic styles
|
|
48
70
|
*/
|
|
49
71
|
export class Text extends Graphic implements IHasAlphaFactor, ICanvasEventReceiver {
|
|
50
72
|
|
|
@@ -9,7 +9,7 @@ import { USDObject } from "../../engine-components/export/usdz/ThreeUSDZExporter
|
|
|
9
9
|
import { Behaviour } from "../Component.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* LookAt behaviour makes the object look at a target object or the camera.
|
|
12
|
+
* The [LookAt](https://engine.needle.tools/docs/api/LookAt) behaviour makes the object look at a target object or the camera.
|
|
13
13
|
* It can also invert the forward direction and keep the up direction.
|
|
14
14
|
*
|
|
15
15
|
* @summary Makes the object look at a target object or the camera
|
|
@@ -7,7 +7,7 @@ import { type IPointerClickHandler, PointerEventData } from "../ui/index.js";
|
|
|
7
7
|
import { ObjectRaycaster } from "../ui/Raycaster.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* OpenURLMode defines how a URL should be opened.
|
|
10
|
+
* [OpenURL](https://engine.needle.tools/docs/api/OpenURL) OpenURLMode defines how a URL should be opened.
|
|
11
11
|
*/
|
|
12
12
|
export enum OpenURLMode {
|
|
13
13
|
NewTab = 0,
|