@relu-interactives/spatial-ecs 0.3.12 → 0.3.14
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/dist/{System-31wk-A0g.d.cts → System-BhnLw0fZ.d.cts} +7 -0
- package/dist/{System-31wk-A0g.d.ts → System-BhnLw0fZ.d.ts} +7 -0
- package/dist/{XRHandPose-DawOR0uR.d.cts → XRHandPose-LR4EhboN.d.cts} +25 -9
- package/dist/{XRHandPose-DhAd9Qi6.d.ts → XRHandPose-SZ7ou63b.d.ts} +25 -9
- package/dist/{chunk-OMDYLFTN.js → chunk-3LDQ4GVZ.js} +5 -5
- package/dist/chunk-3LDQ4GVZ.js.map +1 -0
- package/dist/{chunk-7ZIN6TGT.js → chunk-PNQ7HDQC.js} +3 -3
- package/dist/{chunk-7ZIN6TGT.js.map → chunk-PNQ7HDQC.js.map} +1 -1
- package/dist/{chunk-ID7U4FER.js → chunk-UHJ4MDIM.js} +7 -4
- package/dist/chunk-UHJ4MDIM.js.map +1 -0
- package/dist/{chunk-LCJ6IH2O.js → chunk-XHMOFI3Q.js} +104 -16
- package/dist/chunk-XHMOFI3Q.js.map +1 -0
- package/dist/components/index.cjs +3 -3
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +1 -1
- package/dist/docs/guide/vr-and-hand-poses.md +5 -3
- package/dist/factories/index.cjs +6 -3
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +2 -2
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.js +3 -3
- package/dist/{index-Xm3im4Pt.d.cts → index-BL5EWkwY.d.cts} +2 -2
- package/dist/{index-B49322Q3.d.ts → index-ByiUoIoh.d.ts} +2 -2
- package/dist/{index-DJ9bn9SF.d.cts → index-CbrjAm_8.d.cts} +23 -1
- package/dist/{index-M0I5B3JA.d.ts → index-CvIXdHzx.d.ts} +23 -1
- package/dist/index.cjs +106 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -8
- package/dist/index.d.ts +45 -8
- package/dist/index.js +8 -8
- package/dist/systems/index.cjs +102 -14
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.ts +2 -2
- package/dist/systems/index.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/worldSnapshotUtils.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-ID7U4FER.js.map +0 -1
- package/dist/chunk-LCJ6IH2O.js.map +0 -1
- package/dist/chunk-OMDYLFTN.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { k as EcsSystem, C as Component, W as WorldEntityView, T as TransformComponent, l as World, S as SpawnPrefabSource, m as SpawnPrefabOptions, n as ComponentClass, o as ParentLookup, p as EcsEntityKind, O as ObjectManagementSystem, q as SubtreeSnapshot, r as EntityId, s as ExternalRefWarning } from './System-
|
|
2
|
-
export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFactory, w as ComponentInput, x as ComponentKind, y as DropdownInput, z as DropdownOption, B as EcsComponentFactoryKind, F as EcsEntityEditorKind, G as EntityInput, H as FloatInput, I as InputSystem, J as IntersectionResult, K as KeyboardKey, L as KeyboardKeys, M as MouseButton, N as PREFAB_FILE_VERSION, Q as PREFAB_FILE_VERSION_NESTED, R as PrefabAsset, U as RemapSnapshotOptions, X as RenderSystem, Y as SelectionListener, Z as SliderInput, _ as TextInput, $ as ToggleInput, a0 as TransformSyncSystem, a1 as Vec3, a2 as Vector2Input, a3 as Vector3Input, a4 as clearPrefabCache, a5 as despawnPrefab, a6 as loadPrefab, a7 as parsePrefabAsset, a8 as prefabFileVersionFor, a9 as remapSnapshotEntityIds, aa as setPrefabAssetUrlResolver, ab as spawnPrefab } from './System-
|
|
1
|
+
import { k as EcsSystem, C as Component, W as WorldEntityView, T as TransformComponent, l as World, S as SpawnPrefabSource, m as SpawnPrefabOptions, n as ComponentClass, o as ParentLookup, p as EcsEntityKind, O as ObjectManagementSystem, q as SubtreeSnapshot, r as EntityId, s as ExternalRefWarning } from './System-BhnLw0fZ.cjs';
|
|
2
|
+
export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFactory, w as ComponentInput, x as ComponentKind, y as DropdownInput, z as DropdownOption, B as EcsComponentFactoryKind, F as EcsEntityEditorKind, G as EntityInput, H as FloatInput, I as InputSystem, J as IntersectionResult, K as KeyboardKey, L as KeyboardKeys, M as MouseButton, N as PREFAB_FILE_VERSION, Q as PREFAB_FILE_VERSION_NESTED, R as PrefabAsset, U as RemapSnapshotOptions, X as RenderSystem, Y as SelectionListener, Z as SliderInput, _ as TextInput, $ as ToggleInput, a0 as TransformSyncSystem, a1 as Vec3, a2 as Vector2Input, a3 as Vector3Input, a4 as clearPrefabCache, a5 as despawnPrefab, a6 as loadPrefab, a7 as parsePrefabAsset, a8 as prefabFileVersionFor, a9 as remapSnapshotEntityIds, aa as setPrefabAssetUrlResolver, ab as spawnPrefab } from './System-BhnLw0fZ.cjs';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import { O as Object3DRef, an as XrHandPreset } from './XRHandPose-
|
|
5
|
-
export { az as AnimationStateCallbacks, aA as AnimationStateMachine, aB as AnimationStateManager, aC as StateMachine } from './XRHandPose-
|
|
6
|
-
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-
|
|
7
|
-
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-
|
|
8
|
-
export { i as CoreComponents } from './index-
|
|
4
|
+
import { O as Object3DRef, an as XrHandPreset } from './XRHandPose-LR4EhboN.cjs';
|
|
5
|
+
export { az as AnimationStateCallbacks, aA as AnimationStateMachine, aB as AnimationStateManager, aC as StateMachine } from './XRHandPose-LR4EhboN.cjs';
|
|
6
|
+
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-CbrjAm_8.cjs';
|
|
7
|
+
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-CbrjAm_8.cjs';
|
|
8
|
+
export { i as CoreComponents } from './index-BL5EWkwY.cjs';
|
|
9
9
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.cjs';
|
|
10
10
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
11
11
|
import { X as XrHandPoseDefinition, a as XrFinger, b as XrHandPoseOrientation } from './handPose-dFxqbFFY.cjs';
|
|
@@ -807,6 +807,43 @@ declare function sampleTeleportArc(origin: THREE.Vector3, direction: THREE.Vecto
|
|
|
807
807
|
*/
|
|
808
808
|
declare function arcGroundCrossing(points: THREE.Vector3[], groundY: number): THREE.Vector3 | null;
|
|
809
809
|
|
|
810
|
+
/**
|
|
811
|
+
* Decides when a teleport may actually commit.
|
|
812
|
+
*
|
|
813
|
+
* Teleport commits on RELEASE so the user can cancel by aiming away — the
|
|
814
|
+
* standard interaction. The trap is that a release edge alone is not evidence
|
|
815
|
+
* of intent: on hand tracking the SAME pinch drives grabbing, so the release
|
|
816
|
+
* that drops an object looks identical to the release that ends a teleport aim.
|
|
817
|
+
* Without this gate, letting go of a grabbed object teleports the player
|
|
818
|
+
* whenever the arc happens to land somewhere valid — and passing an object
|
|
819
|
+
* between hands does it too.
|
|
820
|
+
*
|
|
821
|
+
* The rule is simply: a release only commits if this source engaged an aim
|
|
822
|
+
* first, and going busy (grabbing) discards any aim it had engaged.
|
|
823
|
+
*
|
|
824
|
+
* Keyed per input source so the two hands are independent.
|
|
825
|
+
*/
|
|
826
|
+
declare class TeleportAimGate {
|
|
827
|
+
private readonly aiming;
|
|
828
|
+
/**
|
|
829
|
+
* Feed one frame for one source.
|
|
830
|
+
*
|
|
831
|
+
* @returns whether the teleport should commit this frame.
|
|
832
|
+
*/
|
|
833
|
+
update(source: object, aiming: boolean, releasing: boolean): boolean;
|
|
834
|
+
/** True if this source currently has an aim engaged. */
|
|
835
|
+
isAiming(source: object): boolean;
|
|
836
|
+
/**
|
|
837
|
+
* Drop a source's aim without committing.
|
|
838
|
+
*
|
|
839
|
+
* Called when a hand starts interacting, so the release that ends the grab
|
|
840
|
+
* cannot cash in an aim engaged before it.
|
|
841
|
+
*
|
|
842
|
+
* @returns whether an aim was actually discarded.
|
|
843
|
+
*/
|
|
844
|
+
cancel(source: object): boolean;
|
|
845
|
+
}
|
|
846
|
+
|
|
810
847
|
/**
|
|
811
848
|
* Materials for tracked-hand meshes.
|
|
812
849
|
*
|
|
@@ -928,4 +965,4 @@ declare class ThrowVelocityTracker {
|
|
|
928
965
|
*/
|
|
929
966
|
declare function angularVelocityFrom(previous: THREE.Quaternion, current: THREE.Quaternion, deltaTime: number): THREE.Vector3;
|
|
930
967
|
|
|
931
|
-
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, type ApplyPrefabToSnapshotResult, Behaviour, Component, type ComponentValueMaps, EcsEntityKind, EcsSystem, type EcsWorldComponentSnapshot, type EcsWorldStateSnapshotLike, EntityId, ExternalRefWarning, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, HYDRATABLE_ENTITY_KINDS, type HandMaterialOptions, type HydrateOptions, type HydrateWorldFromSnapshotResult, type InstantiateSubtreeResult, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, NODE_KEY_SEPARATOR, type NestedRegion, type NodeKeyMaps, type NodeMaps, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectManagementSystem, ParentLookup, SHARED_MODEL_RESOURCE_FLAG, ScriptObject, type SerializeEntitySubtreeResult, SpawnPrefabOptions, SpawnPrefabSource, SubtreeSnapshot, ThrowVelocityTracker, VELOCITY_SAMPLES, type VelocitySample, World, WorldEntityView, XrCapabilities, XrFinger, XrHandPoseDefinition, XrHandPoseEventDetail, XrHandPoseOrientation, XrInputState, angularVelocityFrom, applyHandMaterial, applyPrefabToSnapshotInstances, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearModelCache, cloneHandPose, collectDiffPaths, collectDirectPrefabDependencies, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, createHandMaterial, decanonicalizeComponentValue, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, getHandPosePreset, groupOverridePaths, handPoseFromCurls, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadSharedGltf, mergeComponentValue, parseOverride, resolveDracoDecoderPath, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, serializeEntitySubtree, setDracoDecoderPath };
|
|
968
|
+
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, type ApplyPrefabToSnapshotResult, Behaviour, Component, type ComponentValueMaps, EcsEntityKind, EcsSystem, type EcsWorldComponentSnapshot, type EcsWorldStateSnapshotLike, EntityId, ExternalRefWarning, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, HYDRATABLE_ENTITY_KINDS, type HandMaterialOptions, type HydrateOptions, type HydrateWorldFromSnapshotResult, type InstantiateSubtreeResult, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, NODE_KEY_SEPARATOR, type NestedRegion, type NodeKeyMaps, type NodeMaps, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectManagementSystem, ParentLookup, SHARED_MODEL_RESOURCE_FLAG, ScriptObject, type SerializeEntitySubtreeResult, SpawnPrefabOptions, SpawnPrefabSource, SubtreeSnapshot, TeleportAimGate, ThrowVelocityTracker, VELOCITY_SAMPLES, type VelocitySample, World, WorldEntityView, XrCapabilities, XrFinger, XrHandPoseDefinition, XrHandPoseEventDetail, XrHandPoseOrientation, XrInputState, angularVelocityFrom, applyHandMaterial, applyPrefabToSnapshotInstances, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearModelCache, cloneHandPose, collectDiffPaths, collectDirectPrefabDependencies, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, createHandMaterial, decanonicalizeComponentValue, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, getHandPosePreset, groupOverridePaths, handPoseFromCurls, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadSharedGltf, mergeComponentValue, parseOverride, resolveDracoDecoderPath, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, serializeEntitySubtree, setDracoDecoderPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { k as EcsSystem, C as Component, W as WorldEntityView, T as TransformComponent, l as World, S as SpawnPrefabSource, m as SpawnPrefabOptions, n as ComponentClass, o as ParentLookup, p as EcsEntityKind, O as ObjectManagementSystem, q as SubtreeSnapshot, r as EntityId, s as ExternalRefWarning } from './System-
|
|
2
|
-
export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFactory, w as ComponentInput, x as ComponentKind, y as DropdownInput, z as DropdownOption, B as EcsComponentFactoryKind, F as EcsEntityEditorKind, G as EntityInput, H as FloatInput, I as InputSystem, J as IntersectionResult, K as KeyboardKey, L as KeyboardKeys, M as MouseButton, N as PREFAB_FILE_VERSION, Q as PREFAB_FILE_VERSION_NESTED, R as PrefabAsset, U as RemapSnapshotOptions, X as RenderSystem, Y as SelectionListener, Z as SliderInput, _ as TextInput, $ as ToggleInput, a0 as TransformSyncSystem, a1 as Vec3, a2 as Vector2Input, a3 as Vector3Input, a4 as clearPrefabCache, a5 as despawnPrefab, a6 as loadPrefab, a7 as parsePrefabAsset, a8 as prefabFileVersionFor, a9 as remapSnapshotEntityIds, aa as setPrefabAssetUrlResolver, ab as spawnPrefab } from './System-
|
|
1
|
+
import { k as EcsSystem, C as Component, W as WorldEntityView, T as TransformComponent, l as World, S as SpawnPrefabSource, m as SpawnPrefabOptions, n as ComponentClass, o as ParentLookup, p as EcsEntityKind, O as ObjectManagementSystem, q as SubtreeSnapshot, r as EntityId, s as ExternalRefWarning } from './System-BhnLw0fZ.js';
|
|
2
|
+
export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFactory, w as ComponentInput, x as ComponentKind, y as DropdownInput, z as DropdownOption, B as EcsComponentFactoryKind, F as EcsEntityEditorKind, G as EntityInput, H as FloatInput, I as InputSystem, J as IntersectionResult, K as KeyboardKey, L as KeyboardKeys, M as MouseButton, N as PREFAB_FILE_VERSION, Q as PREFAB_FILE_VERSION_NESTED, R as PrefabAsset, U as RemapSnapshotOptions, X as RenderSystem, Y as SelectionListener, Z as SliderInput, _ as TextInput, $ as ToggleInput, a0 as TransformSyncSystem, a1 as Vec3, a2 as Vector2Input, a3 as Vector3Input, a4 as clearPrefabCache, a5 as despawnPrefab, a6 as loadPrefab, a7 as parsePrefabAsset, a8 as prefabFileVersionFor, a9 as remapSnapshotEntityIds, aa as setPrefabAssetUrlResolver, ab as spawnPrefab } from './System-BhnLw0fZ.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import { O as Object3DRef, an as XrHandPreset } from './XRHandPose-
|
|
5
|
-
export { az as AnimationStateCallbacks, aA as AnimationStateMachine, aB as AnimationStateManager, aC as StateMachine } from './XRHandPose-
|
|
6
|
-
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-
|
|
7
|
-
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-
|
|
8
|
-
export { i as CoreComponents } from './index-
|
|
4
|
+
import { O as Object3DRef, an as XrHandPreset } from './XRHandPose-SZ7ou63b.js';
|
|
5
|
+
export { az as AnimationStateCallbacks, aA as AnimationStateMachine, aB as AnimationStateManager, aC as StateMachine } from './XRHandPose-SZ7ou63b.js';
|
|
6
|
+
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-CvIXdHzx.js';
|
|
7
|
+
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-CvIXdHzx.js';
|
|
8
|
+
export { i as CoreComponents } from './index-ByiUoIoh.js';
|
|
9
9
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.js';
|
|
10
10
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
11
11
|
import { X as XrHandPoseDefinition, a as XrFinger, b as XrHandPoseOrientation } from './handPose-dFxqbFFY.js';
|
|
@@ -807,6 +807,43 @@ declare function sampleTeleportArc(origin: THREE.Vector3, direction: THREE.Vecto
|
|
|
807
807
|
*/
|
|
808
808
|
declare function arcGroundCrossing(points: THREE.Vector3[], groundY: number): THREE.Vector3 | null;
|
|
809
809
|
|
|
810
|
+
/**
|
|
811
|
+
* Decides when a teleport may actually commit.
|
|
812
|
+
*
|
|
813
|
+
* Teleport commits on RELEASE so the user can cancel by aiming away — the
|
|
814
|
+
* standard interaction. The trap is that a release edge alone is not evidence
|
|
815
|
+
* of intent: on hand tracking the SAME pinch drives grabbing, so the release
|
|
816
|
+
* that drops an object looks identical to the release that ends a teleport aim.
|
|
817
|
+
* Without this gate, letting go of a grabbed object teleports the player
|
|
818
|
+
* whenever the arc happens to land somewhere valid — and passing an object
|
|
819
|
+
* between hands does it too.
|
|
820
|
+
*
|
|
821
|
+
* The rule is simply: a release only commits if this source engaged an aim
|
|
822
|
+
* first, and going busy (grabbing) discards any aim it had engaged.
|
|
823
|
+
*
|
|
824
|
+
* Keyed per input source so the two hands are independent.
|
|
825
|
+
*/
|
|
826
|
+
declare class TeleportAimGate {
|
|
827
|
+
private readonly aiming;
|
|
828
|
+
/**
|
|
829
|
+
* Feed one frame for one source.
|
|
830
|
+
*
|
|
831
|
+
* @returns whether the teleport should commit this frame.
|
|
832
|
+
*/
|
|
833
|
+
update(source: object, aiming: boolean, releasing: boolean): boolean;
|
|
834
|
+
/** True if this source currently has an aim engaged. */
|
|
835
|
+
isAiming(source: object): boolean;
|
|
836
|
+
/**
|
|
837
|
+
* Drop a source's aim without committing.
|
|
838
|
+
*
|
|
839
|
+
* Called when a hand starts interacting, so the release that ends the grab
|
|
840
|
+
* cannot cash in an aim engaged before it.
|
|
841
|
+
*
|
|
842
|
+
* @returns whether an aim was actually discarded.
|
|
843
|
+
*/
|
|
844
|
+
cancel(source: object): boolean;
|
|
845
|
+
}
|
|
846
|
+
|
|
810
847
|
/**
|
|
811
848
|
* Materials for tracked-hand meshes.
|
|
812
849
|
*
|
|
@@ -928,4 +965,4 @@ declare class ThrowVelocityTracker {
|
|
|
928
965
|
*/
|
|
929
966
|
declare function angularVelocityFrom(previous: THREE.Quaternion, current: THREE.Quaternion, deltaTime: number): THREE.Vector3;
|
|
930
967
|
|
|
931
|
-
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, type ApplyPrefabToSnapshotResult, Behaviour, Component, type ComponentValueMaps, EcsEntityKind, EcsSystem, type EcsWorldComponentSnapshot, type EcsWorldStateSnapshotLike, EntityId, ExternalRefWarning, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, HYDRATABLE_ENTITY_KINDS, type HandMaterialOptions, type HydrateOptions, type HydrateWorldFromSnapshotResult, type InstantiateSubtreeResult, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, NODE_KEY_SEPARATOR, type NestedRegion, type NodeKeyMaps, type NodeMaps, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectManagementSystem, ParentLookup, SHARED_MODEL_RESOURCE_FLAG, ScriptObject, type SerializeEntitySubtreeResult, SpawnPrefabOptions, SpawnPrefabSource, SubtreeSnapshot, ThrowVelocityTracker, VELOCITY_SAMPLES, type VelocitySample, World, WorldEntityView, XrCapabilities, XrFinger, XrHandPoseDefinition, XrHandPoseEventDetail, XrHandPoseOrientation, XrInputState, angularVelocityFrom, applyHandMaterial, applyPrefabToSnapshotInstances, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearModelCache, cloneHandPose, collectDiffPaths, collectDirectPrefabDependencies, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, createHandMaterial, decanonicalizeComponentValue, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, getHandPosePreset, groupOverridePaths, handPoseFromCurls, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadSharedGltf, mergeComponentValue, parseOverride, resolveDracoDecoderPath, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, serializeEntitySubtree, setDracoDecoderPath };
|
|
968
|
+
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, type ApplyPrefabToSnapshotResult, Behaviour, Component, type ComponentValueMaps, EcsEntityKind, EcsSystem, type EcsWorldComponentSnapshot, type EcsWorldStateSnapshotLike, EntityId, ExternalRefWarning, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, HYDRATABLE_ENTITY_KINDS, type HandMaterialOptions, type HydrateOptions, type HydrateWorldFromSnapshotResult, type InstantiateSubtreeResult, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, NODE_KEY_SEPARATOR, type NestedRegion, type NodeKeyMaps, type NodeMaps, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectManagementSystem, ParentLookup, SHARED_MODEL_RESOURCE_FLAG, ScriptObject, type SerializeEntitySubtreeResult, SpawnPrefabOptions, SpawnPrefabSource, SubtreeSnapshot, TeleportAimGate, ThrowVelocityTracker, VELOCITY_SAMPLES, type VelocitySample, World, WorldEntityView, XrCapabilities, XrFinger, XrHandPoseDefinition, XrHandPoseEventDetail, XrHandPoseOrientation, XrInputState, angularVelocityFrom, applyHandMaterial, applyPrefabToSnapshotInstances, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearModelCache, cloneHandPose, collectDiffPaths, collectDirectPrefabDependencies, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, createHandMaterial, decanonicalizeComponentValue, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, getHandPosePreset, groupOverridePaths, handPoseFromCurls, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadSharedGltf, mergeComponentValue, parseOverride, resolveDracoDecoderPath, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, serializeEntitySubtree, setDracoDecoderPath };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, VRTeleportAreaSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem, spawnPrefab, despawnPrefab, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-
|
|
2
|
-
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, AnimationSystem, AudioSystem, Behaviour, CURLED_COS, CameraSyncSystem, DEFAULT_ENTER_CONFIDENCE, DEFAULT_EXIT_CONFIDENCE, DEFAULT_LOST_GRACE_SECONDS, DEFAULT_MIN_HOLD_SECONDS, EnvironmentSyncSystem, FALLBACK_HAND_SCALE, HYDRATABLE_ENTITY_KINDS, HandPoseTracker, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MATCH_FALLOFF, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, MaterialSyncSystem, MeshGeometrySystem, NODE_KEY_SEPARATOR, NO_XR_CAPABILITIES, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectVisibilitySystem, PINCH_FINGERS, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, STRAIGHT_COS, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, ThrowVelocityTracker, TransformSyncSystem, VELOCITY_SAMPLES, VRTeleportAreaSystem, VideoSystem, XRControllerVisualSystem, XRHandPoseSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_FINGERS, XR_HOVER_SHELL_FLAG, angularVelocityFrom, applyHandMaterial, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeFingerCurl, computeHandShape, computeInstanceOverrides, computePalmPose, computePalmWidth, computePinch, computeSpread, createHandMaterial, decanonicalizeComponentValue, despawnPrefab, encodeOverride, estimateHandScale, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, matchHandPose, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, readXrCapabilities, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-
|
|
3
|
-
import { registerDefaultFactories } from './chunk-
|
|
4
|
-
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-
|
|
5
|
-
import { ObjectManagementSystem } from './chunk-
|
|
6
|
-
export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-
|
|
7
|
-
import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent } from './chunk-
|
|
8
|
-
export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, cloneHandPose, getHandPosePreset, handPoseFromCurls } from './chunk-
|
|
1
|
+
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, VRTeleportAreaSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem, spawnPrefab, despawnPrefab, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-XHMOFI3Q.js';
|
|
2
|
+
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, AnimationSystem, AudioSystem, Behaviour, CURLED_COS, CameraSyncSystem, DEFAULT_ENTER_CONFIDENCE, DEFAULT_EXIT_CONFIDENCE, DEFAULT_LOST_GRACE_SECONDS, DEFAULT_MIN_HOLD_SECONDS, EnvironmentSyncSystem, FALLBACK_HAND_SCALE, HYDRATABLE_ENTITY_KINDS, HandPoseTracker, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MATCH_FALLOFF, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, MaterialSyncSystem, MeshGeometrySystem, NODE_KEY_SEPARATOR, NO_XR_CAPABILITIES, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectVisibilitySystem, PINCH_FINGERS, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, STRAIGHT_COS, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, TeleportAimGate, ThrowVelocityTracker, TransformSyncSystem, VELOCITY_SAMPLES, VRTeleportAreaSystem, VideoSystem, XRControllerVisualSystem, XRHandPoseSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_FINGERS, XR_HOVER_SHELL_FLAG, angularVelocityFrom, applyHandMaterial, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeFingerCurl, computeHandShape, computeInstanceOverrides, computePalmPose, computePalmWidth, computePinch, computeSpread, createHandMaterial, decanonicalizeComponentValue, despawnPrefab, encodeOverride, estimateHandScale, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, matchHandPose, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, readXrCapabilities, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-XHMOFI3Q.js';
|
|
3
|
+
import { registerDefaultFactories } from './chunk-UHJ4MDIM.js';
|
|
4
|
+
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-UHJ4MDIM.js';
|
|
5
|
+
import { ObjectManagementSystem } from './chunk-PNQ7HDQC.js';
|
|
6
|
+
export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-PNQ7HDQC.js';
|
|
7
|
+
import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent } from './chunk-3LDQ4GVZ.js';
|
|
8
|
+
export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, cloneHandPose, getHandPosePreset, handPoseFromCurls } from './chunk-3LDQ4GVZ.js';
|
|
9
9
|
import './chunk-QHILSPT4.js';
|
|
10
10
|
import { normalizeDebugValue, DEBUG_CHANGE_IGNORED_SYSTEMS, cloneHistoryValue } from './chunk-OWQSESTO.js';
|
|
11
11
|
import { __name } from './chunk-OY7ZODZP.js';
|
package/dist/systems/index.cjs
CHANGED
|
@@ -2120,8 +2120,8 @@ var _XRInteractableComponent = class _XRInteractableComponent extends Component
|
|
|
2120
2120
|
this.attachPoints = (options?.attachPoints ?? []).map(
|
|
2121
2121
|
(point) => createAttachPoint(point)
|
|
2122
2122
|
);
|
|
2123
|
-
this.
|
|
2124
|
-
this.
|
|
2123
|
+
this.applyVelocityOnRelease = options?.applyVelocityOnRelease ?? true;
|
|
2124
|
+
this.velocityScale = options?.velocityScale ?? 1;
|
|
2125
2125
|
this.hoverBehavior = options?.hoverBehavior ?? "color";
|
|
2126
2126
|
this.hoverColor = options?.hoverColor ?? "#4da3ff";
|
|
2127
2127
|
this.hoverScale = options?.hoverScale ?? 1.06;
|
|
@@ -2165,7 +2165,7 @@ var _XRInteractorComponent = class _XRInteractorComponent extends Component {
|
|
|
2165
2165
|
this.handColor = options?.handColor ?? "#e8b48a";
|
|
2166
2166
|
this.handOpacity = options?.handOpacity ?? 1;
|
|
2167
2167
|
this.handEmissiveIntensity = options?.handEmissiveIntensity ?? 0;
|
|
2168
|
-
this.
|
|
2168
|
+
this.rayVisibility = options?.rayVisibility ?? "interacting";
|
|
2169
2169
|
this.rayColor = options?.rayColor ?? "#4da3ff";
|
|
2170
2170
|
this.rayThickness = options?.rayThickness ?? 6e-3;
|
|
2171
2171
|
}
|
|
@@ -5438,11 +5438,15 @@ function restorePostCreateComponents(world, objectManagementSystem, targetEntity
|
|
|
5438
5438
|
)
|
|
5439
5439
|
);
|
|
5440
5440
|
}
|
|
5441
|
-
if (typeof sourceInteractable.
|
|
5442
|
-
interactable.
|
|
5441
|
+
if (typeof sourceInteractable.applyVelocityOnRelease === "boolean") {
|
|
5442
|
+
interactable.applyVelocityOnRelease = sourceInteractable.applyVelocityOnRelease;
|
|
5443
|
+
} else if (typeof sourceInteractable.throwOnRelease === "boolean") {
|
|
5444
|
+
interactable.applyVelocityOnRelease = sourceInteractable.throwOnRelease;
|
|
5443
5445
|
}
|
|
5444
|
-
if (typeof sourceInteractable.
|
|
5445
|
-
interactable.
|
|
5446
|
+
if (typeof sourceInteractable.velocityScale === "number") {
|
|
5447
|
+
interactable.velocityScale = sourceInteractable.velocityScale;
|
|
5448
|
+
} else if (typeof sourceInteractable.throwStrength === "number") {
|
|
5449
|
+
interactable.velocityScale = sourceInteractable.throwStrength;
|
|
5446
5450
|
}
|
|
5447
5451
|
const grabPos = asRecord3(sourceInteractable.grabOffsetPosition);
|
|
5448
5452
|
if (grabPos) {
|
|
@@ -5518,8 +5522,10 @@ function restorePostCreateComponents(world, objectManagementSystem, targetEntity
|
|
|
5518
5522
|
if (typeof sourceInteractor.handEmissiveIntensity === "number") {
|
|
5519
5523
|
interactor.handEmissiveIntensity = sourceInteractor.handEmissiveIntensity;
|
|
5520
5524
|
}
|
|
5521
|
-
if (typeof sourceInteractor.
|
|
5522
|
-
interactor.
|
|
5525
|
+
if (typeof sourceInteractor.rayVisibility === "string") {
|
|
5526
|
+
interactor.rayVisibility = sourceInteractor.rayVisibility;
|
|
5527
|
+
} else if (typeof sourceInteractor.showRay === "boolean") {
|
|
5528
|
+
interactor.rayVisibility = sourceInteractor.showRay ? "interacting" : "never";
|
|
5523
5529
|
}
|
|
5524
5530
|
if (typeof sourceInteractor.rayColor === "string") {
|
|
5525
5531
|
interactor.rayColor = sourceInteractor.rayColor;
|
|
@@ -6326,6 +6332,7 @@ function hydrateWorldFromSnapshotDetailed(snapshot, world, objectManagementSyste
|
|
|
6326
6332
|
isDefault: true
|
|
6327
6333
|
};
|
|
6328
6334
|
}
|
|
6335
|
+
payload.skipDefaultChildren = true;
|
|
6329
6336
|
const createdEntityId = objectManagementSystem.createNow(kind, world, payload);
|
|
6330
6337
|
idMap.set(sourceEntityId, createdEntityId);
|
|
6331
6338
|
}
|
|
@@ -8959,8 +8966,8 @@ var _XRInteractionSystem = class _XRInteractionSystem {
|
|
|
8959
8966
|
if (held.restoreBodyType !== null && physics) {
|
|
8960
8967
|
physics.values.rigidbody.type = held.restoreBodyType;
|
|
8961
8968
|
const dynamic = held.restoreBodyType === "dynamic";
|
|
8962
|
-
if (dynamic && interactable?.
|
|
8963
|
-
const velocity = held.tracker.computeVelocity(this.elapsed).multiplyScalar(interactable.
|
|
8969
|
+
if (dynamic && interactable?.applyVelocityOnRelease) {
|
|
8970
|
+
const velocity = held.tracker.computeVelocity(this.elapsed).multiplyScalar(interactable.velocityScale);
|
|
8964
8971
|
const spin = held.angularVelocity;
|
|
8965
8972
|
setPhysicsLiveRef(physics, "pendingVelocity", {
|
|
8966
8973
|
linear: { x: velocity.x, y: velocity.y, z: velocity.z },
|
|
@@ -9041,6 +9048,25 @@ var _XRInteractionSystem = class _XRInteractionSystem {
|
|
|
9041
9048
|
isGrabbing() {
|
|
9042
9049
|
return this.grabs.size > 0;
|
|
9043
9050
|
}
|
|
9051
|
+
/**
|
|
9052
|
+
* Whether this hand's primary action is committed to interaction.
|
|
9053
|
+
*
|
|
9054
|
+
* True while the hand holds something, and also while it merely HOVERS a
|
|
9055
|
+
* grabbable — because the pinch that is about to grab must not be read as a
|
|
9056
|
+
* teleport by the locomotion system. Without the hover half, the first pinch
|
|
9057
|
+
* of a grab teleports the player, and so does the pinch that takes an object
|
|
9058
|
+
* from the other hand.
|
|
9059
|
+
*/
|
|
9060
|
+
isHandBusy(world, handedness) {
|
|
9061
|
+
if (this.isGrabbingWith(handedness)) return true;
|
|
9062
|
+
const hover = this.getHoverFor(handedness);
|
|
9063
|
+
if (!hover) return false;
|
|
9064
|
+
const interactable = world.getComponent(
|
|
9065
|
+
hover.entityId,
|
|
9066
|
+
XRInteractableComponent
|
|
9067
|
+
);
|
|
9068
|
+
return Boolean(interactable?.enabled && interactable.grabbable);
|
|
9069
|
+
}
|
|
9044
9070
|
/** True when THIS hand is holding something. */
|
|
9045
9071
|
isGrabbingWith(handedness) {
|
|
9046
9072
|
for (const input of this.grabs.keys()) {
|
|
@@ -9099,6 +9125,42 @@ function sampleTeleportArc(origin, direction, out = [], options) {
|
|
|
9099
9125
|
}
|
|
9100
9126
|
__name(sampleTeleportArc, "sampleTeleportArc");
|
|
9101
9127
|
|
|
9128
|
+
// core/xr/teleportAimGate.ts
|
|
9129
|
+
var _TeleportAimGate = class _TeleportAimGate {
|
|
9130
|
+
constructor() {
|
|
9131
|
+
this.aiming = /* @__PURE__ */ new WeakSet();
|
|
9132
|
+
}
|
|
9133
|
+
/**
|
|
9134
|
+
* Feed one frame for one source.
|
|
9135
|
+
*
|
|
9136
|
+
* @returns whether the teleport should commit this frame.
|
|
9137
|
+
*/
|
|
9138
|
+
update(source, aiming, releasing) {
|
|
9139
|
+
const hadAim = this.aiming.has(source);
|
|
9140
|
+
if (aiming) this.aiming.add(source);
|
|
9141
|
+
if (!releasing) return false;
|
|
9142
|
+
this.aiming.delete(source);
|
|
9143
|
+
return hadAim;
|
|
9144
|
+
}
|
|
9145
|
+
/** True if this source currently has an aim engaged. */
|
|
9146
|
+
isAiming(source) {
|
|
9147
|
+
return this.aiming.has(source);
|
|
9148
|
+
}
|
|
9149
|
+
/**
|
|
9150
|
+
* Drop a source's aim without committing.
|
|
9151
|
+
*
|
|
9152
|
+
* Called when a hand starts interacting, so the release that ends the grab
|
|
9153
|
+
* cannot cash in an aim engaged before it.
|
|
9154
|
+
*
|
|
9155
|
+
* @returns whether an aim was actually discarded.
|
|
9156
|
+
*/
|
|
9157
|
+
cancel(source) {
|
|
9158
|
+
return this.aiming.delete(source);
|
|
9159
|
+
}
|
|
9160
|
+
};
|
|
9161
|
+
__name(_TeleportAimGate, "TeleportAimGate");
|
|
9162
|
+
var TeleportAimGate = _TeleportAimGate;
|
|
9163
|
+
|
|
9102
9164
|
// core/systems/XRLocomotionSystem.ts
|
|
9103
9165
|
var UP = new THREE26__namespace.Vector3(0, 1, 0);
|
|
9104
9166
|
var AXIS_DEADZONE = 0.5;
|
|
@@ -9116,10 +9178,24 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
|
|
|
9116
9178
|
this.aimValid = false;
|
|
9117
9179
|
/** Sources currently aiming via thumbstick (hysteresis, so it doesn't chatter). */
|
|
9118
9180
|
this.stickAiming = /* @__PURE__ */ new WeakSet();
|
|
9181
|
+
/** Gates teleport commits on a prior aim. See {@link TeleportAimGate}. */
|
|
9182
|
+
this.teleportAim = new TeleportAimGate();
|
|
9119
9183
|
/** True once we've tried to self-heal camera parenting for this session. */
|
|
9120
9184
|
this.parentingChecked = false;
|
|
9185
|
+
/**
|
|
9186
|
+
* Optional; when wired, hands busy grabbing are excluded from teleport.
|
|
9187
|
+
*
|
|
9188
|
+
* On hand tracking the SAME pinch drives both grabbing and teleport aiming,
|
|
9189
|
+
* so without this a user who picks something up is teleported at the same
|
|
9190
|
+
* moment.
|
|
9191
|
+
*/
|
|
9192
|
+
this.interactionSystem = null;
|
|
9121
9193
|
this.inputSystem = inputSystem;
|
|
9122
9194
|
}
|
|
9195
|
+
/** Wire the interaction system so grabs suppress teleport on that hand. */
|
|
9196
|
+
setInteractionSystem(interactionSystem) {
|
|
9197
|
+
this.interactionSystem = interactionSystem;
|
|
9198
|
+
}
|
|
9123
9199
|
update(world, deltaTime) {
|
|
9124
9200
|
this.aimCurve = [];
|
|
9125
9201
|
this.landingPoint = null;
|
|
@@ -9238,9 +9314,18 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
|
|
|
9238
9314
|
const targets = this.collectTeleportTargets(world);
|
|
9239
9315
|
for (const input of inputs) {
|
|
9240
9316
|
const source = input;
|
|
9317
|
+
if (input.handedness !== "none" && this.interactionSystem?.isHandBusy(world, input.handedness)) {
|
|
9318
|
+
if (this.teleportAim.cancel(source)) {
|
|
9319
|
+
this.aimCurve = [];
|
|
9320
|
+
this.landingPoint = null;
|
|
9321
|
+
this.aimValid = false;
|
|
9322
|
+
}
|
|
9323
|
+
continue;
|
|
9324
|
+
}
|
|
9241
9325
|
const stick = this.readStickAim(input, source);
|
|
9242
9326
|
const aiming = input.select || stick.aiming;
|
|
9243
|
-
const
|
|
9327
|
+
const releasing = input.selectEnd || stick.released;
|
|
9328
|
+
const commit = this.teleportAim.update(source, aiming, releasing);
|
|
9244
9329
|
if (!aiming && !commit) continue;
|
|
9245
9330
|
const points = sampleTeleportArc(
|
|
9246
9331
|
input.rayOrigin,
|
|
@@ -9713,9 +9798,12 @@ var _XRControllerVisualSystem = class _XRControllerVisualSystem {
|
|
|
9713
9798
|
* clutter implying the whole scene is clickable.
|
|
9714
9799
|
*/
|
|
9715
9800
|
shouldShowRay(interactor, side) {
|
|
9716
|
-
|
|
9801
|
+
const visibility = interactor?.rayVisibility ?? "interacting";
|
|
9802
|
+
if (visibility === "never") return false;
|
|
9803
|
+
if (visibility === "always") return true;
|
|
9717
9804
|
if (!this.interactionSystem) return true;
|
|
9718
|
-
|
|
9805
|
+
if (this.interactionSystem.isGrabbingWith(side)) return false;
|
|
9806
|
+
return this.interactionSystem.getHoverFor(side) !== null;
|
|
9719
9807
|
}
|
|
9720
9808
|
/** Push the author's ray colour and thickness onto the mesh. */
|
|
9721
9809
|
applyRayStyle(ray, interactor) {
|