@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.
- package/CHANGELOG.md +8 -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-BNIUpreS.min.js} +107 -107
- package/dist/{needle-engine.bundle-Dl3TFYyv.js → needle-engine.bundle-DauZUYl7.js} +2347 -1845
- package/dist/{needle-engine.bundle-J4k4znv8.umd.cjs → needle-engine.bundle-tjI5Fq2c.umd.cjs} +108 -108
- package/dist/needle-engine.d.ts +4022 -419
- 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 +37 -1
- package/lib/engine/engine_physics.js +37 -1
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +78 -0
- package/lib/engine/engine_physics_rapier.js +78 -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 +28 -6
- package/lib/engine-components/ContactShadows.js +33 -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 +40 -12
- 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 +35 -0
- package/lib/engine-components/Renderer.js +36 -2
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RigidBody.d.ts +57 -5
- package/lib/engine-components/RigidBody.js +57 -5
- package/lib/engine-components/RigidBody.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 +39 -6
- package/lib/engine-components/ScreenCapture.js +39 -6
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/SeeThrough.d.ts +70 -5
- package/lib/engine-components/SeeThrough.js +70 -5
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/ShadowCatcher.d.ts +56 -4
- package/lib/engine-components/ShadowCatcher.js +56 -4
- package/lib/engine-components/ShadowCatcher.js.map +1 -1
- package/lib/engine-components/Skybox.d.ts +43 -7
- package/lib/engine-components/Skybox.js +43 -7
- package/lib/engine-components/Skybox.js.map +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 +103 -14
- package/lib/engine-components/timeline/PlayableDirector.js +95 -25
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/timeline/TimelineModels.d.ts +14 -0
- package/lib/engine-components/timeline/TimelineModels.js +4 -0
- package/lib/engine-components/timeline/TimelineModels.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 +41 -1
- package/src/engine/engine_physics_rapier.ts +81 -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 +41 -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 +43 -15
- 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 +35 -1
- package/src/engine-components/RigidBody.ts +64 -8
- package/src/engine-components/SceneSwitcher.ts +11 -0
- package/src/engine-components/ScreenCapture.ts +42 -9
- package/src/engine-components/SeeThrough.ts +76 -9
- package/src/engine-components/ShadowCatcher.ts +61 -6
- package/src/engine-components/Skybox.ts +48 -12
- 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 +108 -27
- package/src/engine-components/timeline/SignalAsset.ts +1 -1
- package/src/engine-components/timeline/TimelineModels.ts +18 -2
- 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
|
@@ -13,24 +13,85 @@ import { Behaviour } from "../Component.js";
|
|
|
13
13
|
const debugParam = getParam("debugviewbox");
|
|
14
14
|
const disabledGizmoColor = new RGBAColor(.5, .5, .5, .5);
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Defines how the {@link ViewBox} component applies camera framing adjustments.
|
|
18
|
+
*
|
|
19
|
+
* - `"continuous"`: Camera framing is continuously updated while the ViewBox is active. Use for animated or dynamic ViewBoxes.
|
|
20
|
+
* - `"once"`: Camera framing is applied once when the ViewBox becomes active, then updates stop. Use for initial framing with subsequent user control.
|
|
21
|
+
*/
|
|
16
22
|
export type ViewBoxMode = "continuous" | "once";
|
|
17
23
|
|
|
18
24
|
/**
|
|
19
|
-
*
|
|
20
|
-
* This is useful for
|
|
25
|
+
* [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.
|
|
26
|
+
* This component is useful for framing characters, objects, or scenes in the center of the view while ensuring they remain fully visible.
|
|
27
|
+
* You can animate or scale the viewbox to create dynamic zoom effects, cinematic transitions, or responsive framing.
|
|
21
28
|
*
|
|
29
|
+
* [](https://engine.needle.tools/samples/bike-scrollytelling-responsive-3d)
|
|
30
|
+
*
|
|
31
|
+
* The ViewBox component works by adjusting the camera's focus rect settings (offset and zoom) to ensure that the box defined by the
|
|
32
|
+
* GameObject's position, rotation, and scale fits perfectly within the visible viewport. It supports different modes for one-time
|
|
33
|
+
* fitting or continuous adjustment, making it versatile for both static compositions and animated sequences.
|
|
34
|
+
*
|
|
35
|
+
* **Key Features:**
|
|
36
|
+
* - Automatically adjusts camera framing to fit the box area
|
|
37
|
+
* - Works with any screen size and aspect ratio
|
|
38
|
+
* - Supports one-time fitting or continuous updates
|
|
39
|
+
* - Can be animated for dynamic zoom and framing effects
|
|
40
|
+
* - Multiple ViewBoxes can be active, with the most recently enabled taking priority
|
|
41
|
+
* - Handles camera positioning to ensure the box is visible (moves camera if inside the box)
|
|
42
|
+
*
|
|
43
|
+
* **Common Use Cases:**
|
|
44
|
+
* - Character framing in cutscenes or dialogue
|
|
45
|
+
* - Product showcases with guaranteed visibility
|
|
46
|
+
* - Scrollytelling experiences with animated camera movements
|
|
47
|
+
* - Responsive layouts that adapt to different screen sizes
|
|
48
|
+
* - UI-driven camera transitions
|
|
49
|
+
*
|
|
22
50
|
* - [Example on needle.run](https://viewbox-demo-z23hmxbz2gkayo-z1nyzm6.needle.run/)
|
|
23
|
-
* - [Scrollytelling Demo using animated Viewbox](https://scrollytelling-bike-z23hmxb2gnu5a.needle.run/)
|
|
51
|
+
* - [Scrollytelling Demo using animated Viewbox](https://scrollytelling-bike-z23hmxb2gnu5a.needle.run/)
|
|
24
52
|
* - [Example on Stackblitz](https://stackblitz.com/edit/needle-engine-view-box-example)
|
|
25
|
-
*
|
|
26
|
-
* @example Add a
|
|
53
|
+
*
|
|
54
|
+
* @example Basic setup - Add a ViewBox component to frame an object
|
|
55
|
+
* ```ts
|
|
56
|
+
* const viewBox = new Object3D();
|
|
57
|
+
* viewBox.position.set(0, 1, 0); // Position the viewbox center
|
|
58
|
+
* viewBox.scale.set(2, 2, 2); // Define the box size
|
|
59
|
+
* viewBox.addComponent(ViewBox, { debug: true });
|
|
60
|
+
* scene.add(viewBox);
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Animated ViewBox for zoom effects
|
|
64
|
+
* ```ts
|
|
65
|
+
* const viewBox = new Object3D();
|
|
66
|
+
* viewBox.addComponent(ViewBox, { mode: "continuous" });
|
|
67
|
+
* scene.add(viewBox);
|
|
68
|
+
*
|
|
69
|
+
* // Animate the viewbox scale over time
|
|
70
|
+
* function update() {
|
|
71
|
+
* const scale = 1 + Math.sin(Date.now() * 0.001) * 0.5;
|
|
72
|
+
* viewBox.scale.setScalar(scale);
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example One-time fitting with user control afterwards
|
|
27
77
|
* ```ts
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
78
|
+
* const viewBox = new Object3D();
|
|
79
|
+
* viewBox.addComponent(ViewBox, {
|
|
80
|
+
* mode: "once", // Fit once, then allow free camera control
|
|
81
|
+
* referenceFieldOfView: 60
|
|
82
|
+
* });
|
|
83
|
+
* scene.add(viewBox);
|
|
32
84
|
* ```
|
|
33
|
-
|
|
85
|
+
*
|
|
86
|
+
* @see {@link Camera} - The camera component that ViewBox controls
|
|
87
|
+
* @see {@link OrbitControls} - Camera controls that work alongside ViewBox
|
|
88
|
+
* @see {@link DragControls} - Alternative camera controls compatible with ViewBox
|
|
89
|
+
* @see {@link LookAtConstraint} - Another way to control camera targeting
|
|
90
|
+
* @see {@link SceneSwitcher} - Can be combined with ViewBox for scene transitions
|
|
91
|
+
* @see {@link Context.setCameraFocusRect} - The underlying focus rect API used by ViewBox
|
|
92
|
+
* @see {@link Context.focusRectSettings} - Manual control of focus rect settings
|
|
93
|
+
* @see {@link ViewBoxMode} - The mode type for controlling ViewBox behavior
|
|
94
|
+
*
|
|
34
95
|
* @summary Automatically fits a box area into the camera view
|
|
35
96
|
* @category Camera and Controls
|
|
36
97
|
* @group Components
|
|
@@ -40,22 +101,50 @@ export type ViewBoxMode = "continuous" | "once";
|
|
|
40
101
|
export class ViewBox extends Behaviour {
|
|
41
102
|
|
|
42
103
|
/**
|
|
43
|
-
*
|
|
104
|
+
* Array of all active ViewBox instances in the scene.
|
|
105
|
+
* When multiple ViewBoxes are enabled, the last one in the array (most recently enabled) takes priority and controls the camera.
|
|
106
|
+
* Other ViewBoxes remain registered but inactive, displayed with a dimmed gizmo color when debug visualization is enabled.
|
|
44
107
|
*/
|
|
45
108
|
static readonly instances: ViewBox[] = [];
|
|
46
109
|
|
|
47
110
|
/**
|
|
48
|
-
* The reference field of view
|
|
49
|
-
*
|
|
111
|
+
* The reference field of view (in degrees) used to calculate how the box should fit within the camera view.
|
|
112
|
+
* This determines the baseline camera FOV for fitting calculations.
|
|
113
|
+
*
|
|
114
|
+
* **Behavior:**
|
|
115
|
+
* - If set to `-1` (default), the component will automatically use the camera's FOV on the first frame
|
|
116
|
+
* - Should typically match your camera's FOV for predictable framing
|
|
117
|
+
* - Can be set to a different value to create specific framing effects
|
|
118
|
+
*
|
|
119
|
+
* **Example:**
|
|
120
|
+
* If your camera has an FOV of 60° and you set `referenceFieldOfView` to 60, the ViewBox will fit objects
|
|
121
|
+
* as they would appear with that field of view. Setting it to a wider FOV (e.g., 90) makes objects appear
|
|
122
|
+
* smaller, while a narrower FOV (e.g., 30) makes them appear larger.
|
|
123
|
+
*
|
|
124
|
+
* @see {@link Camera} for the camera component and its FOV property
|
|
125
|
+
* @default -1 (automatically uses the camera's FOV on the first frame)
|
|
50
126
|
*/
|
|
51
127
|
@serializable()
|
|
52
128
|
referenceFieldOfView: number = -1;
|
|
53
129
|
|
|
54
130
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* - "
|
|
131
|
+
* Controls how the ViewBox applies camera adjustments.
|
|
132
|
+
*
|
|
133
|
+
* **Modes:**
|
|
134
|
+
* - `"once"`: Applies the framing adjustment once when the ViewBox becomes active, then stops updating.
|
|
135
|
+
* This is ideal when you want to frame the view initially but allow users to freely zoom, pan, or orbit afterwards.
|
|
136
|
+
* Perfect for interactive scenes where you want a good starting view but full user control.
|
|
137
|
+
*
|
|
138
|
+
* - `"continuous"`: Continuously updates the camera framing while this ViewBox is active.
|
|
139
|
+
* Use this when animating or scaling the ViewBox over time, or when you need the framing to constantly adjust.
|
|
140
|
+
* Great for cutscenes, scrollytelling, or any scenario with animated ViewBoxes.
|
|
141
|
+
*
|
|
142
|
+
* **Example Use Cases:**
|
|
143
|
+
* - Set to `"once"` for: Initial scene framing, product showcases where users explore freely after initial framing
|
|
144
|
+
* - Set to `"continuous"` for: Animated zoom effects, scrollytelling sequences, dynamic camera movements tied to ViewBox transforms
|
|
145
|
+
*
|
|
146
|
+
* @see {@link ViewBoxMode} for the type definition
|
|
147
|
+
* @default "continuous"
|
|
59
148
|
*/
|
|
60
149
|
@serializable()
|
|
61
150
|
get mode() { return this._mode; }
|
|
@@ -68,7 +157,18 @@ export class ViewBox extends Behaviour {
|
|
|
68
157
|
private _mode: ViewBoxMode = "continuous";
|
|
69
158
|
|
|
70
159
|
/**
|
|
71
|
-
*
|
|
160
|
+
* Enables debug visualization and logging for this ViewBox instance.
|
|
161
|
+
*
|
|
162
|
+
* **When enabled, you will see:**
|
|
163
|
+
* - A yellow wireframe box showing the active ViewBox bounds in 3D space
|
|
164
|
+
* - Gray wireframe boxes for inactive ViewBox instances
|
|
165
|
+
* - A red dashed outline on screen showing the projected box in 2D (when using `?debugviewbox` URL parameter)
|
|
166
|
+
* - Console logs for mode changes, FOV settings, and camera adjustments
|
|
167
|
+
*
|
|
168
|
+
* **Tip:** You can also enable debug visualization globally for all ViewBoxes by adding `?debugviewbox` to your URL.
|
|
169
|
+
*
|
|
170
|
+
* @see {@link Gizmos} for the gizmo rendering system used for debug visualization
|
|
171
|
+
* @default false
|
|
72
172
|
*/
|
|
73
173
|
@serializable()
|
|
74
174
|
debug: boolean = false;
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import { Behaviour } from "../Component.js";
|
|
2
2
|
import type { XRControllerMovement } from "./controllers/XRControllerMovement.js";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
/**
|
|
5
|
+
* Marks a GameObject as a valid teleportation target for VR locomotion.
|
|
6
|
+
* Add this component to objects or surfaces where users should be able to teleport.
|
|
7
|
+
*
|
|
8
|
+
* **Usage:**
|
|
9
|
+
* - Add to floor surfaces, platforms, or designated teleport spots
|
|
10
|
+
* - Works with {@link XRControllerMovement} component's teleport system
|
|
11
|
+
* - Can be used to restrict teleportation to specific areas
|
|
12
|
+
*
|
|
13
|
+
* **Setup:**
|
|
14
|
+
* 1. Add this component to GameObjects that should be teleport destinations
|
|
15
|
+
* 2. Configure {@link XRControllerMovement} to use teleport targets (optional)
|
|
16
|
+
* 3. Test teleportation in VR mode
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Make a platform teleportable
|
|
21
|
+
* const platform = myPlatform.addComponent(TeleportTarget);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @summary Marker component for valid VR teleportation destinations
|
|
8
25
|
* @category XR
|
|
9
26
|
* @group Components
|
|
27
|
+
* @see {@link XRControllerMovement} for VR locomotion and teleport configuration
|
|
28
|
+
* @see {@link WebXR} for general WebXR setup
|
|
10
29
|
*/
|
|
11
30
|
export class TeleportTarget extends Behaviour {
|
|
12
31
|
|
|
@@ -23,12 +23,13 @@ const debug = getParam("debugwebxr");
|
|
|
23
23
|
const debugQuicklook = getParam("debugusdz");
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Use the WebXR component to enable VR and AR on iOS and Android in your scene. VisionOS support is also provided via QuickLook USDZ export.
|
|
26
|
+
* Use the WebXR component to enable VR and AR on **iOS and Android** in your scene. VisionOS support is also provided via QuickLook USDZ export.
|
|
27
27
|
*
|
|
28
|
-
* The WebXR component is a simple to use wrapper around the {@link NeedleXRSession} API and adds some additional features like creating buttons for AR, VR, enabling default movement behaviour ({@link XRControllerMovement}) and controller rendering ({@link XRControllerModel}), as well as handling AR placement and Quicklook USDZ export.
|
|
28
|
+
* The WebXR component is a simple to use wrapper around the {@link NeedleXRSession} API and adds some additional features like creating buttons for AR, VR, enabling default movement behaviour ({@link XRControllerMovement}) and controller rendering ({@link XRControllerModel}), as well as handling AR placement and Quicklook USDZ export.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* 
|
|
31
31
|
*
|
|
32
|
+
*
|
|
32
33
|
* @example Enable VR and AR support using code
|
|
33
34
|
* ```ts
|
|
34
35
|
* import { onStart, WebXR } from "@needle-tools/engine";
|
|
@@ -54,6 +55,13 @@ const debugQuicklook = getParam("debugusdz");
|
|
|
54
55
|
* @summary WebXR Component for VR and AR support
|
|
55
56
|
* @category XR
|
|
56
57
|
* @group Components
|
|
58
|
+
* @see {@link NeedleXRSession} for low-level XR API
|
|
59
|
+
* @see {@link XRControllerMovement} for VR locomotion
|
|
60
|
+
* @see {@link WebARSessionRoot} for AR session configuration
|
|
61
|
+
* @see {@link Avatar} for networked user avatars
|
|
62
|
+
* @link https://engine.needle.tools/docs/xr.html
|
|
63
|
+
* @link https://engine.needle.tools/samples/?overlay=samples&tag=xr
|
|
64
|
+
* @link https://engine.needle.tools/samples/collaborative-sandbox
|
|
57
65
|
*/
|
|
58
66
|
export class WebXR extends Behaviour {
|
|
59
67
|
|
|
@@ -6,32 +6,61 @@ import { XRFlag } from "./XRFlag.js";
|
|
|
6
6
|
|
|
7
7
|
export const debug = getParam("debugavatar");
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Event arguments for avatar marker creation and destruction events
|
|
11
|
+
*/
|
|
9
12
|
export type AvatarMarkerEventArgs = {
|
|
13
|
+
/** The AvatarMarker component instance */
|
|
10
14
|
avatarMarker: AvatarMarker;
|
|
15
|
+
/** The GameObject that contains the avatar marker */
|
|
11
16
|
gameObject: Object3D;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* This
|
|
19
|
+
/**
|
|
20
|
+
* Marks a GameObject as being controlled or owned by a player in networked XR sessions.
|
|
21
|
+
* This is used internally by the networking system to identify player-controlled objects.
|
|
22
|
+
*
|
|
23
|
+
* **Note:** This is an internal marker class. For most use cases, use the {@link Avatar} component instead.
|
|
24
|
+
*
|
|
25
|
+
* @summary Internal marker for player-controlled objects in networked sessions
|
|
26
|
+
* @category XR
|
|
27
|
+
* @category Networking
|
|
28
|
+
* @group Components
|
|
29
|
+
* @see {@link Avatar} for avatar setup and configuration
|
|
17
30
|
*/
|
|
18
|
-
// We might be updating this system in the future to a centralized API (PlayerView)
|
|
31
|
+
// We might be updating this system in the future to a centralized API (PlayerView)
|
|
19
32
|
// but since currently quite a few core components rely on it, we're keeping it for now
|
|
20
33
|
export class AvatarMarker extends Behaviour {
|
|
21
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Get an avatar marker by index from the global list of avatar markers.
|
|
37
|
+
* @param index The index in the instances array
|
|
38
|
+
* @returns The AvatarMarker at the specified index, or null if index is out of bounds
|
|
39
|
+
*/
|
|
22
40
|
public static getAvatar(index: number): AvatarMarker | null {
|
|
23
41
|
if (index >= 0 && index < AvatarMarker.instances.length)
|
|
24
42
|
return AvatarMarker.instances[index];
|
|
25
43
|
return null;
|
|
26
44
|
}
|
|
27
45
|
|
|
46
|
+
/** Global list of all active AvatarMarker instances */
|
|
28
47
|
public static instances: AvatarMarker[] = [];
|
|
29
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Subscribe to avatar marker creation events.
|
|
51
|
+
* @param cb Callback function called when a new avatar marker is created
|
|
52
|
+
* @returns The callback function (for removal)
|
|
53
|
+
*/
|
|
30
54
|
public static onAvatarMarkerCreated(cb: (args: AvatarMarkerEventArgs) => void): Function {
|
|
31
55
|
AvatarMarker._onNewAvatarMarkerAdded.push(cb);
|
|
32
56
|
return cb;
|
|
33
57
|
}
|
|
34
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Subscribe to avatar marker destruction events.
|
|
61
|
+
* @param cb Callback function called when an avatar marker is destroyed
|
|
62
|
+
* @returns The callback function (for removal)
|
|
63
|
+
*/
|
|
35
64
|
public static onAvatarMarkerDestroyed(cb: (args: AvatarMarkerEventArgs) => void): Function {
|
|
36
65
|
AvatarMarker._onAvatarMarkerDestroyed.push(cb);
|
|
37
66
|
return cb;
|
|
@@ -41,9 +70,12 @@ export class AvatarMarker extends Behaviour {
|
|
|
41
70
|
private static _onAvatarMarkerDestroyed: Array<(args: AvatarMarkerEventArgs) => void> = [];
|
|
42
71
|
|
|
43
72
|
|
|
73
|
+
/** The network connection ID of the player who owns this avatar */
|
|
44
74
|
public connectionId!: string;
|
|
75
|
+
/** Reference to the avatar GameObject with optional XR flags */
|
|
45
76
|
public avatar?: Object3D & { flags?: XRFlag[] }
|
|
46
77
|
|
|
78
|
+
/** @internal */
|
|
47
79
|
awake() {
|
|
48
80
|
AvatarMarker.instances.push(this);
|
|
49
81
|
if (debug)
|
|
@@ -53,6 +85,7 @@ export class AvatarMarker extends Behaviour {
|
|
|
53
85
|
cb({ avatarMarker: this, gameObject: this.gameObject });
|
|
54
86
|
}
|
|
55
87
|
|
|
88
|
+
/** @internal */
|
|
56
89
|
onDestroy() {
|
|
57
90
|
AvatarMarker.instances.splice(AvatarMarker.instances.indexOf(this), 1);
|
|
58
91
|
|
|
@@ -60,6 +93,10 @@ export class AvatarMarker extends Behaviour {
|
|
|
60
93
|
cb({ avatarMarker: this, gameObject: this.gameObject });
|
|
61
94
|
}
|
|
62
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Check if this avatar marker represents the local player.
|
|
98
|
+
* @returns True if this avatar belongs to the local player, false otherwise
|
|
99
|
+
*/
|
|
63
100
|
isLocalAvatar() {
|
|
64
101
|
return this.connectionId === this.context.connection.connectionId;
|
|
65
102
|
}
|