@relu-interactives/spatial-ecs 0.3.13 → 0.3.15
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-9mVZVU3K.d.cts → XRHandPose-LR4EhboN.d.cts} +1 -1
- package/dist/{XRHandPose-To0260Lc.d.ts → XRHandPose-SZ7ou63b.d.ts} +1 -1
- package/dist/{chunk-N2634D4W.js → chunk-GULLCPO6.js} +63 -13
- package/dist/chunk-GULLCPO6.js.map +1 -0
- package/dist/{chunk-CHZQ4NXP.js → chunk-PNQ7HDQC.js} +2 -2
- package/dist/{chunk-CHZQ4NXP.js.map → chunk-PNQ7HDQC.js.map} +1 -1
- package/dist/{chunk-JHFBEMXM.js → chunk-UHJ4MDIM.js} +6 -3
- package/dist/chunk-UHJ4MDIM.js.map +1 -0
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/docs/guide/vr-and-hand-poses.md +12 -1
- package/dist/factories/index.cjs +3 -0
- 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 +2 -2
- package/dist/{index-lqw8BM6E.d.cts → index-BKGV3VvQ.d.cts} +11 -4
- package/dist/{index-BPKDsVF7.d.cts → index-BL5EWkwY.d.cts} +2 -2
- package/dist/{index-BbXqWyEZ.d.ts → index-Bi7L3QHF.d.ts} +11 -4
- package/dist/{index-Wzs-8FYa.d.ts → index-ByiUoIoh.d.ts} +2 -2
- package/dist/index.cjs +63 -9
- 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 +6 -6
- package/dist/systems/index.cjs +59 -9
- 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 +2 -2
- 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-JHFBEMXM.js.map +0 -1
- package/dist/chunk-N2634D4W.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, T as RigidbodyState, g as ColliderState, P as PhysicsComponent, o as EntityType, I as ImageComponent, q as ImageTargetAnchor, p as ImageTarget, L as LightComponent, M as MaterialComponent, B as MeshComponent, F as MeshGeometryComponent, J as ModelComponent, N as Name, O as Object3DRef, W as ScriptEntry, V as ScriptComponent, Y as ScriptObjectComponentInput, X as ScriptObjectComponent, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, w as InstancedMeshKind, G as MeshGeometryParameters, v as InstancedMeshComponent, t as InstanceSlotComponent, a6 as VideoComponent, af as XRRigComponent, a4 as VRTeleportAreaComponent, a8 as XRHandPoseComponent, aa as XRInteractableComponent, ac as XRInteractorComponent, ae as XRInteractorSideComponent } from '../XRHandPose-
|
|
2
|
-
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-
|
|
1
|
+
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, T as RigidbodyState, g as ColliderState, P as PhysicsComponent, o as EntityType, I as ImageComponent, q as ImageTargetAnchor, p as ImageTarget, L as LightComponent, M as MaterialComponent, B as MeshComponent, F as MeshGeometryComponent, J as ModelComponent, N as Name, O as Object3DRef, W as ScriptEntry, V as ScriptComponent, Y as ScriptObjectComponentInput, X as ScriptObjectComponent, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, w as InstancedMeshKind, G as MeshGeometryParameters, v as InstancedMeshComponent, t as InstanceSlotComponent, a6 as VideoComponent, af as XRRigComponent, a4 as VRTeleportAreaComponent, a8 as XRHandPoseComponent, aa as XRInteractableComponent, ac as XRInteractorComponent, ae as XRInteractorSideComponent } from '../XRHandPose-LR4EhboN.cjs';
|
|
2
|
+
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-BhnLw0fZ.cjs';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
5
|
import '../handPose-dFxqbFFY.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, T as RigidbodyState, g as ColliderState, P as PhysicsComponent, o as EntityType, I as ImageComponent, q as ImageTargetAnchor, p as ImageTarget, L as LightComponent, M as MaterialComponent, B as MeshComponent, F as MeshGeometryComponent, J as ModelComponent, N as Name, O as Object3DRef, W as ScriptEntry, V as ScriptComponent, Y as ScriptObjectComponentInput, X as ScriptObjectComponent, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, w as InstancedMeshKind, G as MeshGeometryParameters, v as InstancedMeshComponent, t as InstanceSlotComponent, a6 as VideoComponent, af as XRRigComponent, a4 as VRTeleportAreaComponent, a8 as XRHandPoseComponent, aa as XRInteractableComponent, ac as XRInteractorComponent, ae as XRInteractorSideComponent } from '../XRHandPose-
|
|
2
|
-
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-
|
|
1
|
+
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, T as RigidbodyState, g as ColliderState, P as PhysicsComponent, o as EntityType, I as ImageComponent, q as ImageTargetAnchor, p as ImageTarget, L as LightComponent, M as MaterialComponent, B as MeshComponent, F as MeshGeometryComponent, J as ModelComponent, N as Name, O as Object3DRef, W as ScriptEntry, V as ScriptComponent, Y as ScriptObjectComponentInput, X as ScriptObjectComponent, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, w as InstancedMeshKind, G as MeshGeometryParameters, v as InstancedMeshComponent, t as InstanceSlotComponent, a6 as VideoComponent, af as XRRigComponent, a4 as VRTeleportAreaComponent, a8 as XRHandPoseComponent, aa as XRInteractableComponent, ac as XRInteractorComponent, ae as XRInteractorSideComponent } from '../XRHandPose-SZ7ou63b.js';
|
|
2
|
+
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-BhnLw0fZ.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
5
|
import '../handPose-dFxqbFFY.js';
|
package/dist/factories/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
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';
|
|
2
|
+
import '../chunk-PNQ7HDQC.js';
|
|
3
3
|
import '../chunk-3LDQ4GVZ.js';
|
|
4
4
|
import '../chunk-OY7ZODZP.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as EcsSystem, l as World } from './System-
|
|
1
|
+
import { k as EcsSystem, l as World } from './System-BhnLw0fZ.cjs';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
import { k as XrHandJoints, q as XrHandShape } from './handPose-dFxqbFFY.cjs';
|
|
4
4
|
|
|
@@ -501,15 +501,20 @@ declare class XRInteractionSystem implements EcsSystem {
|
|
|
501
501
|
/** True when any source is holding something. */
|
|
502
502
|
isGrabbing(): boolean;
|
|
503
503
|
/**
|
|
504
|
-
* Whether this
|
|
504
|
+
* Whether this input's primary action is committed to interaction.
|
|
505
505
|
*
|
|
506
|
-
* True while the
|
|
506
|
+
* True while the source holds something, and also while it merely HOVERS a
|
|
507
507
|
* grabbable — because the pinch that is about to grab must not be read as a
|
|
508
508
|
* teleport by the locomotion system. Without the hover half, the first pinch
|
|
509
509
|
* of a grab teleports the player, and so does the pinch that takes an object
|
|
510
510
|
* from the other hand.
|
|
511
|
+
*
|
|
512
|
+
* Keyed on the INPUT SOURCE rather than handedness. Vision Pro reports
|
|
513
|
+
* `handedness: "none"` for every gaze-pinch (it is hard-coded in WebKit), so a
|
|
514
|
+
* handedness-keyed check silently never matched there and each pinch both
|
|
515
|
+
* grabbed and teleported.
|
|
511
516
|
*/
|
|
512
|
-
|
|
517
|
+
isSourceBusy(world: World, input: XrInputState): boolean;
|
|
513
518
|
/** True when THIS hand is holding something. */
|
|
514
519
|
isGrabbingWith(handedness: XrInputState["handedness"]): boolean;
|
|
515
520
|
/**
|
|
@@ -545,6 +550,8 @@ declare class XRLocomotionSystem implements EcsSystem {
|
|
|
545
550
|
private aimValid;
|
|
546
551
|
/** Sources currently aiming via thumbstick (hysteresis, so it doesn't chatter). */
|
|
547
552
|
private readonly stickAiming;
|
|
553
|
+
/** Gates teleport commits on a prior aim. See {@link TeleportAimGate}. */
|
|
554
|
+
private readonly teleportAim;
|
|
548
555
|
/** True once we've tried to self-heal camera parenting for this session. */
|
|
549
556
|
private parentingChecked;
|
|
550
557
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, o as EntityType, I as ImageComponent, p as ImageTarget, q as ImageTargetAnchor, r as ImageTargetAnchorOptions, s as ImageTargetReference, t as InstanceSlotComponent, u as InstanceTransform, v as InstancedMeshComponent, w as InstancedMeshKind, L as LightComponent, x as LightValueState, M as MaterialComponent, y as MaterialTypeValue, z as MaterialValueState, B as MeshComponent, F as MeshGeometryComponent, G as MeshGeometryParameters, H as MeshGeometryParametersByKind, J as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, K as PhysicsState, Q as PlaneMeshParameters, R as RadiusHeightMeshParameters, S as RadiusMeshParameters, T as RigidbodyState, U as RigidbodyType, V as ScriptComponent, W as ScriptEntry, X as ScriptObjectComponent, Y as ScriptObjectComponentInput, Z as ScriptObjectRuntimeState, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, a1 as TextureFilteringValue, a2 as TransformModeValue, a3 as TransformSpaceValue, a4 as VRTeleportAreaComponent, a5 as VRTeleportAreaOptions, a6 as VideoComponent, a7 as VrTeleportShape, a8 as XRHandPoseComponent, a9 as XRHandPoseOptions, aa as XRInteractableComponent, ab as XRInteractableOptions, ac as XRInteractorComponent, ad as XRInteractorOptions, ae as XRInteractorSideComponent, af as XRRigComponent, ag as XRRigOptions, ah as XrAttachPoint, ai as XrDistanceGrabBehavior, aj as XrGrabGesture, ak as XrGrabHands, al as XrGrabReach, am as XrHandPoseEntry, an as XrHandPreset, ao as XrInteractorSide, ap as XrInteractorType, aq as XrLocomotionMode, ar as XrTrackingOrigin, as as XrTwoHandRotation, at as createAttachPoint, au as createHandPoseEntry, av as defaultMaterialValue, aw as handPoseDefinitionFor, ax as normalizePhysicsState, ay as setPhysicsLiveRef } from './XRHandPose-
|
|
2
|
-
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-
|
|
1
|
+
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, o as EntityType, I as ImageComponent, p as ImageTarget, q as ImageTargetAnchor, r as ImageTargetAnchorOptions, s as ImageTargetReference, t as InstanceSlotComponent, u as InstanceTransform, v as InstancedMeshComponent, w as InstancedMeshKind, L as LightComponent, x as LightValueState, M as MaterialComponent, y as MaterialTypeValue, z as MaterialValueState, B as MeshComponent, F as MeshGeometryComponent, G as MeshGeometryParameters, H as MeshGeometryParametersByKind, J as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, K as PhysicsState, Q as PlaneMeshParameters, R as RadiusHeightMeshParameters, S as RadiusMeshParameters, T as RigidbodyState, U as RigidbodyType, V as ScriptComponent, W as ScriptEntry, X as ScriptObjectComponent, Y as ScriptObjectComponentInput, Z as ScriptObjectRuntimeState, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, a1 as TextureFilteringValue, a2 as TransformModeValue, a3 as TransformSpaceValue, a4 as VRTeleportAreaComponent, a5 as VRTeleportAreaOptions, a6 as VideoComponent, a7 as VrTeleportShape, a8 as XRHandPoseComponent, a9 as XRHandPoseOptions, aa as XRInteractableComponent, ab as XRInteractableOptions, ac as XRInteractorComponent, ad as XRInteractorOptions, ae as XRInteractorSideComponent, af as XRRigComponent, ag as XRRigOptions, ah as XrAttachPoint, ai as XrDistanceGrabBehavior, aj as XrGrabGesture, ak as XrGrabHands, al as XrGrabReach, am as XrHandPoseEntry, an as XrHandPreset, ao as XrInteractorSide, ap as XrInteractorType, aq as XrLocomotionMode, ar as XrTrackingOrigin, as as XrTwoHandRotation, at as createAttachPoint, au as createHandPoseEntry, av as defaultMaterialValue, aw as handPoseDefinitionFor, ax as normalizePhysicsState, ay as setPhysicsLiveRef } from './XRHandPose-LR4EhboN.cjs';
|
|
2
|
+
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-BhnLw0fZ.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Marks the ROOT entity of a prefab instance and records its link to the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as EcsSystem, l as World } from './System-
|
|
1
|
+
import { k as EcsSystem, l as World } from './System-BhnLw0fZ.js';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
import { k as XrHandJoints, q as XrHandShape } from './handPose-dFxqbFFY.js';
|
|
4
4
|
|
|
@@ -501,15 +501,20 @@ declare class XRInteractionSystem implements EcsSystem {
|
|
|
501
501
|
/** True when any source is holding something. */
|
|
502
502
|
isGrabbing(): boolean;
|
|
503
503
|
/**
|
|
504
|
-
* Whether this
|
|
504
|
+
* Whether this input's primary action is committed to interaction.
|
|
505
505
|
*
|
|
506
|
-
* True while the
|
|
506
|
+
* True while the source holds something, and also while it merely HOVERS a
|
|
507
507
|
* grabbable — because the pinch that is about to grab must not be read as a
|
|
508
508
|
* teleport by the locomotion system. Without the hover half, the first pinch
|
|
509
509
|
* of a grab teleports the player, and so does the pinch that takes an object
|
|
510
510
|
* from the other hand.
|
|
511
|
+
*
|
|
512
|
+
* Keyed on the INPUT SOURCE rather than handedness. Vision Pro reports
|
|
513
|
+
* `handedness: "none"` for every gaze-pinch (it is hard-coded in WebKit), so a
|
|
514
|
+
* handedness-keyed check silently never matched there and each pinch both
|
|
515
|
+
* grabbed and teleported.
|
|
511
516
|
*/
|
|
512
|
-
|
|
517
|
+
isSourceBusy(world: World, input: XrInputState): boolean;
|
|
513
518
|
/** True when THIS hand is holding something. */
|
|
514
519
|
isGrabbingWith(handedness: XrInputState["handedness"]): boolean;
|
|
515
520
|
/**
|
|
@@ -545,6 +550,8 @@ declare class XRLocomotionSystem implements EcsSystem {
|
|
|
545
550
|
private aimValid;
|
|
546
551
|
/** Sources currently aiming via thumbstick (hysteresis, so it doesn't chatter). */
|
|
547
552
|
private readonly stickAiming;
|
|
553
|
+
/** Gates teleport commits on a prior aim. See {@link TeleportAimGate}. */
|
|
554
|
+
private readonly teleportAim;
|
|
548
555
|
/** True once we've tried to self-heal camera parenting for this session. */
|
|
549
556
|
private parentingChecked;
|
|
550
557
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, o as EntityType, I as ImageComponent, p as ImageTarget, q as ImageTargetAnchor, r as ImageTargetAnchorOptions, s as ImageTargetReference, t as InstanceSlotComponent, u as InstanceTransform, v as InstancedMeshComponent, w as InstancedMeshKind, L as LightComponent, x as LightValueState, M as MaterialComponent, y as MaterialTypeValue, z as MaterialValueState, B as MeshComponent, F as MeshGeometryComponent, G as MeshGeometryParameters, H as MeshGeometryParametersByKind, J as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, K as PhysicsState, Q as PlaneMeshParameters, R as RadiusHeightMeshParameters, S as RadiusMeshParameters, T as RigidbodyState, U as RigidbodyType, V as ScriptComponent, W as ScriptEntry, X as ScriptObjectComponent, Y as ScriptObjectComponentInput, Z as ScriptObjectRuntimeState, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, a1 as TextureFilteringValue, a2 as TransformModeValue, a3 as TransformSpaceValue, a4 as VRTeleportAreaComponent, a5 as VRTeleportAreaOptions, a6 as VideoComponent, a7 as VrTeleportShape, a8 as XRHandPoseComponent, a9 as XRHandPoseOptions, aa as XRInteractableComponent, ab as XRInteractableOptions, ac as XRInteractorComponent, ad as XRInteractorOptions, ae as XRInteractorSideComponent, af as XRRigComponent, ag as XRRigOptions, ah as XrAttachPoint, ai as XrDistanceGrabBehavior, aj as XrGrabGesture, ak as XrGrabHands, al as XrGrabReach, am as XrHandPoseEntry, an as XrHandPreset, ao as XrInteractorSide, ap as XrInteractorType, aq as XrLocomotionMode, ar as XrTrackingOrigin, as as XrTwoHandRotation, at as createAttachPoint, au as createHandPoseEntry, av as defaultMaterialValue, aw as handPoseDefinitionFor, ax as normalizePhysicsState, ay as setPhysicsLiveRef } from './XRHandPose-
|
|
2
|
-
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-
|
|
1
|
+
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, o as EntityType, I as ImageComponent, p as ImageTarget, q as ImageTargetAnchor, r as ImageTargetAnchorOptions, s as ImageTargetReference, t as InstanceSlotComponent, u as InstanceTransform, v as InstancedMeshComponent, w as InstancedMeshKind, L as LightComponent, x as LightValueState, M as MaterialComponent, y as MaterialTypeValue, z as MaterialValueState, B as MeshComponent, F as MeshGeometryComponent, G as MeshGeometryParameters, H as MeshGeometryParametersByKind, J as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, K as PhysicsState, Q as PlaneMeshParameters, R as RadiusHeightMeshParameters, S as RadiusMeshParameters, T as RigidbodyState, U as RigidbodyType, V as ScriptComponent, W as ScriptEntry, X as ScriptObjectComponent, Y as ScriptObjectComponentInput, Z as ScriptObjectRuntimeState, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, a1 as TextureFilteringValue, a2 as TransformModeValue, a3 as TransformSpaceValue, a4 as VRTeleportAreaComponent, a5 as VRTeleportAreaOptions, a6 as VideoComponent, a7 as VrTeleportShape, a8 as XRHandPoseComponent, a9 as XRHandPoseOptions, aa as XRInteractableComponent, ab as XRInteractableOptions, ac as XRInteractorComponent, ad as XRInteractorOptions, ae as XRInteractorSideComponent, af as XRRigComponent, ag as XRRigOptions, ah as XrAttachPoint, ai as XrDistanceGrabBehavior, aj as XrGrabGesture, ak as XrGrabHands, al as XrGrabReach, am as XrHandPoseEntry, an as XrHandPreset, ao as XrInteractorSide, ap as XrInteractorType, aq as XrLocomotionMode, ar as XrTrackingOrigin, as as XrTwoHandRotation, at as createAttachPoint, au as createHandPoseEntry, av as defaultMaterialValue, aw as handPoseDefinitionFor, ax as normalizePhysicsState, ay as setPhysicsLiveRef } from './XRHandPose-SZ7ou63b.js';
|
|
2
|
+
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-BhnLw0fZ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Marks the ROOT entity of a prefab instance and records its link to the
|
package/dist/index.cjs
CHANGED
|
@@ -4229,6 +4229,9 @@ function createXRInteractor({
|
|
|
4229
4229
|
});
|
|
4230
4230
|
world.addComponent(entityId, new XRInteractorComponent(options));
|
|
4231
4231
|
scene.add(root);
|
|
4232
|
+
if (payload.skipDefaultChildren) {
|
|
4233
|
+
return entityId;
|
|
4234
|
+
}
|
|
4232
4235
|
for (const side of ["left", "right"]) {
|
|
4233
4236
|
const slot = new THREE51__namespace.Group();
|
|
4234
4237
|
const label = side === "left" ? "Left Interactor" : "Right Interactor";
|
|
@@ -5799,6 +5802,7 @@ function hydrateWorldFromSnapshotDetailed(snapshot, world, objectManagementSyste
|
|
|
5799
5802
|
isDefault: true
|
|
5800
5803
|
};
|
|
5801
5804
|
}
|
|
5805
|
+
payload.skipDefaultChildren = true;
|
|
5802
5806
|
const createdEntityId = objectManagementSystem.createNow(kind, world, payload);
|
|
5803
5807
|
idMap.set(sourceEntityId, createdEntityId);
|
|
5804
5808
|
}
|
|
@@ -11724,17 +11728,22 @@ var _XRInteractionSystem = class _XRInteractionSystem {
|
|
|
11724
11728
|
return this.grabs.size > 0;
|
|
11725
11729
|
}
|
|
11726
11730
|
/**
|
|
11727
|
-
* Whether this
|
|
11731
|
+
* Whether this input's primary action is committed to interaction.
|
|
11728
11732
|
*
|
|
11729
|
-
* True while the
|
|
11733
|
+
* True while the source holds something, and also while it merely HOVERS a
|
|
11730
11734
|
* grabbable — because the pinch that is about to grab must not be read as a
|
|
11731
11735
|
* teleport by the locomotion system. Without the hover half, the first pinch
|
|
11732
11736
|
* of a grab teleports the player, and so does the pinch that takes an object
|
|
11733
11737
|
* from the other hand.
|
|
11738
|
+
*
|
|
11739
|
+
* Keyed on the INPUT SOURCE rather than handedness. Vision Pro reports
|
|
11740
|
+
* `handedness: "none"` for every gaze-pinch (it is hard-coded in WebKit), so a
|
|
11741
|
+
* handedness-keyed check silently never matched there and each pinch both
|
|
11742
|
+
* grabbed and teleported.
|
|
11734
11743
|
*/
|
|
11735
|
-
|
|
11736
|
-
if (this.
|
|
11737
|
-
const hover = this.
|
|
11744
|
+
isSourceBusy(world, input) {
|
|
11745
|
+
if (this.grabs.has(input)) return true;
|
|
11746
|
+
const hover = this.hovers.get(input);
|
|
11738
11747
|
if (!hover) return false;
|
|
11739
11748
|
const interactable = world.getComponent(
|
|
11740
11749
|
hover.entityId,
|
|
@@ -11813,6 +11822,42 @@ function arcGroundCrossing(points, groundY) {
|
|
|
11813
11822
|
}
|
|
11814
11823
|
__name(arcGroundCrossing, "arcGroundCrossing");
|
|
11815
11824
|
|
|
11825
|
+
// core/xr/teleportAimGate.ts
|
|
11826
|
+
var _TeleportAimGate = class _TeleportAimGate {
|
|
11827
|
+
constructor() {
|
|
11828
|
+
this.aiming = /* @__PURE__ */ new WeakSet();
|
|
11829
|
+
}
|
|
11830
|
+
/**
|
|
11831
|
+
* Feed one frame for one source.
|
|
11832
|
+
*
|
|
11833
|
+
* @returns whether the teleport should commit this frame.
|
|
11834
|
+
*/
|
|
11835
|
+
update(source, aiming, releasing) {
|
|
11836
|
+
const hadAim = this.aiming.has(source);
|
|
11837
|
+
if (aiming) this.aiming.add(source);
|
|
11838
|
+
if (!releasing) return false;
|
|
11839
|
+
this.aiming.delete(source);
|
|
11840
|
+
return hadAim || aiming;
|
|
11841
|
+
}
|
|
11842
|
+
/** True if this source currently has an aim engaged. */
|
|
11843
|
+
isAiming(source) {
|
|
11844
|
+
return this.aiming.has(source);
|
|
11845
|
+
}
|
|
11846
|
+
/**
|
|
11847
|
+
* Drop a source's aim without committing.
|
|
11848
|
+
*
|
|
11849
|
+
* Called when a hand starts interacting, so the release that ends the grab
|
|
11850
|
+
* cannot cash in an aim engaged before it.
|
|
11851
|
+
*
|
|
11852
|
+
* @returns whether an aim was actually discarded.
|
|
11853
|
+
*/
|
|
11854
|
+
cancel(source) {
|
|
11855
|
+
return this.aiming.delete(source);
|
|
11856
|
+
}
|
|
11857
|
+
};
|
|
11858
|
+
__name(_TeleportAimGate, "TeleportAimGate");
|
|
11859
|
+
var TeleportAimGate = _TeleportAimGate;
|
|
11860
|
+
|
|
11816
11861
|
// core/systems/XRLocomotionSystem.ts
|
|
11817
11862
|
var UP = new THREE51__namespace.Vector3(0, 1, 0);
|
|
11818
11863
|
var AXIS_DEADZONE = 0.5;
|
|
@@ -11830,6 +11875,8 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
|
|
|
11830
11875
|
this.aimValid = false;
|
|
11831
11876
|
/** Sources currently aiming via thumbstick (hysteresis, so it doesn't chatter). */
|
|
11832
11877
|
this.stickAiming = /* @__PURE__ */ new WeakSet();
|
|
11878
|
+
/** Gates teleport commits on a prior aim. See {@link TeleportAimGate}. */
|
|
11879
|
+
this.teleportAim = new TeleportAimGate();
|
|
11833
11880
|
/** True once we've tried to self-heal camera parenting for this session. */
|
|
11834
11881
|
this.parentingChecked = false;
|
|
11835
11882
|
/**
|
|
@@ -11963,13 +12010,19 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
|
|
|
11963
12010
|
applyTeleport(world, transform, inputs) {
|
|
11964
12011
|
const targets = this.collectTeleportTargets(world);
|
|
11965
12012
|
for (const input of inputs) {
|
|
11966
|
-
|
|
12013
|
+
const source = input;
|
|
12014
|
+
if (this.interactionSystem?.isSourceBusy(world, input)) {
|
|
12015
|
+
if (this.teleportAim.cancel(source)) {
|
|
12016
|
+
this.aimCurve = [];
|
|
12017
|
+
this.landingPoint = null;
|
|
12018
|
+
this.aimValid = false;
|
|
12019
|
+
}
|
|
11967
12020
|
continue;
|
|
11968
12021
|
}
|
|
11969
|
-
const source = input;
|
|
11970
12022
|
const stick = this.readStickAim(input, source);
|
|
11971
|
-
const aiming = input.select || stick.aiming;
|
|
11972
|
-
const
|
|
12023
|
+
const aiming = input.select || input.selectStart || stick.aiming;
|
|
12024
|
+
const releasing = input.selectEnd || stick.released;
|
|
12025
|
+
const commit = this.teleportAim.update(source, aiming, releasing);
|
|
11973
12026
|
if (!aiming && !commit) continue;
|
|
11974
12027
|
const points = sampleTeleportArc(
|
|
11975
12028
|
input.rayOrigin,
|
|
@@ -14758,6 +14811,7 @@ exports.STRAIGHT_COS = STRAIGHT_COS;
|
|
|
14758
14811
|
exports.ScriptBehaviourSystem = ScriptBehaviourSystem;
|
|
14759
14812
|
exports.ScriptObject = ScriptObject;
|
|
14760
14813
|
exports.ScriptObjectSystem = ScriptObjectSystem;
|
|
14814
|
+
exports.TeleportAimGate = TeleportAimGate;
|
|
14761
14815
|
exports.ThrowVelocityTracker = ThrowVelocityTracker;
|
|
14762
14816
|
exports.TransformSyncSystem = TransformSyncSystem;
|
|
14763
14817
|
exports.VELOCITY_SAMPLES = VELOCITY_SAMPLES;
|