@relu-interactives/spatial-ecs 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{XRHandPose-DawOR0uR.d.cts → XRHandPose-9mVZVU3K.d.cts} +24 -8
  2. package/dist/{XRHandPose-DhAd9Qi6.d.ts → XRHandPose-To0260Lc.d.ts} +24 -8
  3. package/dist/{chunk-OMDYLFTN.js → chunk-3LDQ4GVZ.js} +5 -5
  4. package/dist/chunk-3LDQ4GVZ.js.map +1 -0
  5. package/dist/{chunk-7ZIN6TGT.js → chunk-CHZQ4NXP.js} +3 -3
  6. package/dist/{chunk-7ZIN6TGT.js.map → chunk-CHZQ4NXP.js.map} +1 -1
  7. package/dist/{chunk-ID7U4FER.js → chunk-JHFBEMXM.js} +4 -4
  8. package/dist/{chunk-ID7U4FER.js.map → chunk-JHFBEMXM.js.map} +1 -1
  9. package/dist/{chunk-LCJ6IH2O.js → chunk-N2634D4W.js} +57 -14
  10. package/dist/chunk-N2634D4W.js.map +1 -0
  11. package/dist/components/index.cjs +3 -3
  12. package/dist/components/index.cjs.map +1 -1
  13. package/dist/components/index.d.cts +2 -2
  14. package/dist/components/index.d.ts +2 -2
  15. package/dist/components/index.js +1 -1
  16. package/dist/docs/guide/vr-and-hand-poses.md +5 -3
  17. package/dist/factories/index.cjs +3 -3
  18. package/dist/factories/index.cjs.map +1 -1
  19. package/dist/factories/index.d.cts +1 -1
  20. package/dist/factories/index.d.ts +1 -1
  21. package/dist/factories/index.js +3 -3
  22. package/dist/{index-Xm3im4Pt.d.cts → index-BPKDsVF7.d.cts} +1 -1
  23. package/dist/{index-M0I5B3JA.d.ts → index-BbXqWyEZ.d.ts} +20 -0
  24. package/dist/{index-B49322Q3.d.ts → index-Wzs-8FYa.d.ts} +1 -1
  25. package/dist/{index-DJ9bn9SF.d.cts → index-lqw8BM6E.d.cts} +20 -0
  26. package/dist/index.cjs +56 -13
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +5 -5
  29. package/dist/index.d.ts +5 -5
  30. package/dist/index.js +8 -8
  31. package/dist/systems/index.cjs +56 -13
  32. package/dist/systems/index.cjs.map +1 -1
  33. package/dist/systems/index.d.cts +1 -1
  34. package/dist/systems/index.d.ts +1 -1
  35. package/dist/systems/index.js +3 -3
  36. package/package.json +1 -1
  37. package/dist/chunk-LCJ6IH2O.js.map +0 -1
  38. package/dist/chunk-OMDYLFTN.js.map +0 -1
@@ -1,4 +1,4 @@
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-DawOR0uR.cjs';
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-9mVZVU3K.cjs';
2
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-31wk-A0g.cjs';
3
3
  import * as THREE from 'three';
4
4
  import '@dimforge/rapier3d-compat';
@@ -1,4 +1,4 @@
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-DhAd9Qi6.js';
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-To0260Lc.js';
2
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-31wk-A0g.js';
3
3
  import * as THREE from 'three';
4
4
  import '@dimforge/rapier3d-compat';
@@ -1,6 +1,6 @@
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-ID7U4FER.js';
2
- import '../chunk-7ZIN6TGT.js';
3
- import '../chunk-OMDYLFTN.js';
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-JHFBEMXM.js';
2
+ import '../chunk-CHZQ4NXP.js';
3
+ import '../chunk-3LDQ4GVZ.js';
4
4
  import '../chunk-OY7ZODZP.js';
5
5
  //# sourceMappingURL=index.js.map
6
6
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
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-DawOR0uR.cjs';
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-9mVZVU3K.cjs';
2
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-31wk-A0g.cjs';
3
3
 
4
4
  /**
@@ -500,6 +500,16 @@ declare class XRInteractionSystem implements EcsSystem {
500
500
  getHeldEntityIds(): Set<number>;
501
501
  /** True when any source is holding something. */
502
502
  isGrabbing(): boolean;
503
+ /**
504
+ * Whether this hand's primary action is committed to interaction.
505
+ *
506
+ * True while the hand holds something, and also while it merely HOVERS a
507
+ * grabbable — because the pinch that is about to grab must not be read as a
508
+ * teleport by the locomotion system. Without the hover half, the first pinch
509
+ * of a grab teleports the player, and so does the pinch that takes an object
510
+ * from the other hand.
511
+ */
512
+ isHandBusy(world: World, handedness: XrInputState["handedness"]): boolean;
503
513
  /** True when THIS hand is holding something. */
504
514
  isGrabbingWith(handedness: XrInputState["handedness"]): boolean;
505
515
  /**
@@ -537,6 +547,16 @@ declare class XRLocomotionSystem implements EcsSystem {
537
547
  private readonly stickAiming;
538
548
  /** True once we've tried to self-heal camera parenting for this session. */
539
549
  private parentingChecked;
550
+ /**
551
+ * Optional; when wired, hands busy grabbing are excluded from teleport.
552
+ *
553
+ * On hand tracking the SAME pinch drives both grabbing and teleport aiming,
554
+ * so without this a user who picks something up is teleported at the same
555
+ * moment.
556
+ */
557
+ private interactionSystem;
558
+ /** Wire the interaction system so grabs suppress teleport on that hand. */
559
+ setInteractionSystem(interactionSystem: XRInteractionSystem | null): void;
540
560
  constructor(inputSystem: XRInputSystem);
541
561
  update(world: World, deltaTime: number): void;
542
562
  /**
@@ -1,4 +1,4 @@
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-DhAd9Qi6.js';
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-To0260Lc.js';
2
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-31wk-A0g.js';
3
3
 
4
4
  /**
@@ -500,6 +500,16 @@ declare class XRInteractionSystem implements EcsSystem {
500
500
  getHeldEntityIds(): Set<number>;
501
501
  /** True when any source is holding something. */
502
502
  isGrabbing(): boolean;
503
+ /**
504
+ * Whether this hand's primary action is committed to interaction.
505
+ *
506
+ * True while the hand holds something, and also while it merely HOVERS a
507
+ * grabbable — because the pinch that is about to grab must not be read as a
508
+ * teleport by the locomotion system. Without the hover half, the first pinch
509
+ * of a grab teleports the player, and so does the pinch that takes an object
510
+ * from the other hand.
511
+ */
512
+ isHandBusy(world: World, handedness: XrInputState["handedness"]): boolean;
503
513
  /** True when THIS hand is holding something. */
504
514
  isGrabbingWith(handedness: XrInputState["handedness"]): boolean;
505
515
  /**
@@ -537,6 +547,16 @@ declare class XRLocomotionSystem implements EcsSystem {
537
547
  private readonly stickAiming;
538
548
  /** True once we've tried to self-heal camera parenting for this session. */
539
549
  private parentingChecked;
550
+ /**
551
+ * Optional; when wired, hands busy grabbing are excluded from teleport.
552
+ *
553
+ * On hand tracking the SAME pinch drives both grabbing and teleport aiming,
554
+ * so without this a user who picks something up is teleported at the same
555
+ * moment.
556
+ */
557
+ private interactionSystem;
558
+ /** Wire the interaction system so grabs suppress teleport on that hand. */
559
+ setInteractionSystem(interactionSystem: XRInteractionSystem | null): void;
540
560
  constructor(inputSystem: XRInputSystem);
541
561
  update(world: World, deltaTime: number): void;
542
562
  /**
package/dist/index.cjs CHANGED
@@ -2852,8 +2852,8 @@ var _XRInteractableComponent = class _XRInteractableComponent extends Component
2852
2852
  this.attachPoints = (options?.attachPoints ?? []).map(
2853
2853
  (point) => createAttachPoint(point)
2854
2854
  );
2855
- this.throwOnRelease = options?.throwOnRelease ?? true;
2856
- this.throwStrength = options?.throwStrength ?? 1;
2855
+ this.applyVelocityOnRelease = options?.applyVelocityOnRelease ?? true;
2856
+ this.velocityScale = options?.velocityScale ?? 1;
2857
2857
  this.hoverBehavior = options?.hoverBehavior ?? "color";
2858
2858
  this.hoverColor = options?.hoverColor ?? "#4da3ff";
2859
2859
  this.hoverScale = options?.hoverScale ?? 1.06;
@@ -2890,7 +2890,7 @@ var _XRInteractorComponent = class _XRInteractorComponent extends Component {
2890
2890
  this.handColor = options?.handColor ?? "#e8b48a";
2891
2891
  this.handOpacity = options?.handOpacity ?? 1;
2892
2892
  this.handEmissiveIntensity = options?.handEmissiveIntensity ?? 0;
2893
- this.showRay = options?.showRay ?? true;
2893
+ this.rayVisibility = options?.rayVisibility ?? "interacting";
2894
2894
  this.rayColor = options?.rayColor ?? "#4da3ff";
2895
2895
  this.rayThickness = options?.rayThickness ?? 6e-3;
2896
2896
  }
@@ -4905,11 +4905,15 @@ function restorePostCreateComponents(world, objectManagementSystem, targetEntity
4905
4905
  )
4906
4906
  );
4907
4907
  }
4908
- if (typeof sourceInteractable.throwOnRelease === "boolean") {
4909
- interactable.throwOnRelease = sourceInteractable.throwOnRelease;
4908
+ if (typeof sourceInteractable.applyVelocityOnRelease === "boolean") {
4909
+ interactable.applyVelocityOnRelease = sourceInteractable.applyVelocityOnRelease;
4910
+ } else if (typeof sourceInteractable.throwOnRelease === "boolean") {
4911
+ interactable.applyVelocityOnRelease = sourceInteractable.throwOnRelease;
4910
4912
  }
4911
- if (typeof sourceInteractable.throwStrength === "number") {
4912
- interactable.throwStrength = sourceInteractable.throwStrength;
4913
+ if (typeof sourceInteractable.velocityScale === "number") {
4914
+ interactable.velocityScale = sourceInteractable.velocityScale;
4915
+ } else if (typeof sourceInteractable.throwStrength === "number") {
4916
+ interactable.velocityScale = sourceInteractable.throwStrength;
4913
4917
  }
4914
4918
  const grabPos = asRecord3(sourceInteractable.grabOffsetPosition);
4915
4919
  if (grabPos) {
@@ -4985,8 +4989,10 @@ function restorePostCreateComponents(world, objectManagementSystem, targetEntity
4985
4989
  if (typeof sourceInteractor.handEmissiveIntensity === "number") {
4986
4990
  interactor.handEmissiveIntensity = sourceInteractor.handEmissiveIntensity;
4987
4991
  }
4988
- if (typeof sourceInteractor.showRay === "boolean") {
4989
- interactor.showRay = sourceInteractor.showRay;
4992
+ if (typeof sourceInteractor.rayVisibility === "string") {
4993
+ interactor.rayVisibility = sourceInteractor.rayVisibility;
4994
+ } else if (typeof sourceInteractor.showRay === "boolean") {
4995
+ interactor.rayVisibility = sourceInteractor.showRay ? "interacting" : "never";
4990
4996
  }
4991
4997
  if (typeof sourceInteractor.rayColor === "string") {
4992
4998
  interactor.rayColor = sourceInteractor.rayColor;
@@ -11635,8 +11641,8 @@ var _XRInteractionSystem = class _XRInteractionSystem {
11635
11641
  if (held.restoreBodyType !== null && physics) {
11636
11642
  physics.values.rigidbody.type = held.restoreBodyType;
11637
11643
  const dynamic = held.restoreBodyType === "dynamic";
11638
- if (dynamic && interactable?.throwOnRelease) {
11639
- const velocity = held.tracker.computeVelocity(this.elapsed).multiplyScalar(interactable.throwStrength);
11644
+ if (dynamic && interactable?.applyVelocityOnRelease) {
11645
+ const velocity = held.tracker.computeVelocity(this.elapsed).multiplyScalar(interactable.velocityScale);
11640
11646
  const spin = held.angularVelocity;
11641
11647
  setPhysicsLiveRef(physics, "pendingVelocity", {
11642
11648
  linear: { x: velocity.x, y: velocity.y, z: velocity.z },
@@ -11717,6 +11723,25 @@ var _XRInteractionSystem = class _XRInteractionSystem {
11717
11723
  isGrabbing() {
11718
11724
  return this.grabs.size > 0;
11719
11725
  }
11726
+ /**
11727
+ * Whether this hand's primary action is committed to interaction.
11728
+ *
11729
+ * True while the hand holds something, and also while it merely HOVERS a
11730
+ * grabbable — because the pinch that is about to grab must not be read as a
11731
+ * teleport by the locomotion system. Without the hover half, the first pinch
11732
+ * of a grab teleports the player, and so does the pinch that takes an object
11733
+ * from the other hand.
11734
+ */
11735
+ isHandBusy(world, handedness) {
11736
+ if (this.isGrabbingWith(handedness)) return true;
11737
+ const hover = this.getHoverFor(handedness);
11738
+ if (!hover) return false;
11739
+ const interactable = world.getComponent(
11740
+ hover.entityId,
11741
+ XRInteractableComponent
11742
+ );
11743
+ return Boolean(interactable?.enabled && interactable.grabbable);
11744
+ }
11720
11745
  /** True when THIS hand is holding something. */
11721
11746
  isGrabbingWith(handedness) {
11722
11747
  for (const input of this.grabs.keys()) {
@@ -11807,8 +11832,20 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
11807
11832
  this.stickAiming = /* @__PURE__ */ new WeakSet();
11808
11833
  /** True once we've tried to self-heal camera parenting for this session. */
11809
11834
  this.parentingChecked = false;
11835
+ /**
11836
+ * Optional; when wired, hands busy grabbing are excluded from teleport.
11837
+ *
11838
+ * On hand tracking the SAME pinch drives both grabbing and teleport aiming,
11839
+ * so without this a user who picks something up is teleported at the same
11840
+ * moment.
11841
+ */
11842
+ this.interactionSystem = null;
11810
11843
  this.inputSystem = inputSystem;
11811
11844
  }
11845
+ /** Wire the interaction system so grabs suppress teleport on that hand. */
11846
+ setInteractionSystem(interactionSystem) {
11847
+ this.interactionSystem = interactionSystem;
11848
+ }
11812
11849
  update(world, deltaTime) {
11813
11850
  this.aimCurve = [];
11814
11851
  this.landingPoint = null;
@@ -11926,6 +11963,9 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
11926
11963
  applyTeleport(world, transform, inputs) {
11927
11964
  const targets = this.collectTeleportTargets(world);
11928
11965
  for (const input of inputs) {
11966
+ if (input.handedness !== "none" && this.interactionSystem?.isHandBusy(world, input.handedness)) {
11967
+ continue;
11968
+ }
11929
11969
  const source = input;
11930
11970
  const stick = this.readStickAim(input, source);
11931
11971
  const aiming = input.select || stick.aiming;
@@ -12402,9 +12442,12 @@ var _XRControllerVisualSystem = class _XRControllerVisualSystem {
12402
12442
  * clutter implying the whole scene is clickable.
12403
12443
  */
12404
12444
  shouldShowRay(interactor, side) {
12405
- if (interactor && !interactor.showRay) return false;
12445
+ const visibility = interactor?.rayVisibility ?? "interacting";
12446
+ if (visibility === "never") return false;
12447
+ if (visibility === "always") return true;
12406
12448
  if (!this.interactionSystem) return true;
12407
- return this.interactionSystem.getHoverFor(side) !== null || this.interactionSystem.isGrabbingWith(side);
12449
+ if (this.interactionSystem.isGrabbingWith(side)) return false;
12450
+ return this.interactionSystem.getHoverFor(side) !== null;
12408
12451
  }
12409
12452
  /** Push the author's ray colour and thickness onto the mesh. */
12410
12453
  applyRayStyle(ray, interactor) {