Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / XRInteractableOptions

Type Alias: XRInteractableOptions ​

ts
type XRInteractableOptions = {
  enabled?: boolean;
  grabbable?: boolean;
  pointable?: boolean;
  grabReach?: XrGrabReach;
  distanceBehavior?: XrDistanceGrabBehavior;
  grabGesture?: XrGrabGesture;
  grabRadius?: number;
  grabOffsetPosition?: {
     x: number;
     y: number;
     z: number;
  };
  grabOffsetRotation?: {
     x: number;
     y: number;
     z: number;
  };
  grabHands?: XrGrabHands;
  twoHandRotation?: XrTwoHandRotation;
  allowTwoHandScale?: boolean;
  minScale?: number;
  maxScale?: number;
  attachPoints?: XrAttachPoint[];
  applyVelocityOnRelease?: boolean;
  velocityScale?: number;
  hoverBehavior?: XrHoverBehavior;
  hoverColor?: string;
  hoverScale?: number;
};

Defined in: components/XRInteractable.ts:77

Optional initializer for XRInteractableComponent.

Properties ​

PropertyTypeDescriptionDefined in
enabled?boolean-components/XRInteractable.ts:78
grabbable?boolean-components/XRInteractable.ts:79
pointable?boolean-components/XRInteractable.ts:80
grabReach?XrGrabReach-components/XRInteractable.ts:81
distanceBehavior?XrDistanceGrabBehavior-components/XRInteractable.ts:82
grabGesture?XrGrabGesture-components/XRInteractable.ts:83
grabRadius?numberMetres within which a physical grab registers.components/XRInteractable.ts:85
grabOffsetPosition?{ x: number; y: number; z: number; }Where the object sits relative to the hand once held.components/XRInteractable.ts:87
grabOffsetPosition.xnumber-components/XRInteractable.ts:87
grabOffsetPosition.ynumber-components/XRInteractable.ts:87
grabOffsetPosition.znumber-components/XRInteractable.ts:87
grabOffsetRotation?{ x: number; y: number; z: number; }Orientation offset, in radians.components/XRInteractable.ts:89
grabOffsetRotation.xnumber-components/XRInteractable.ts:89
grabOffsetRotation.ynumber-components/XRInteractable.ts:89
grabOffsetRotation.znumber-components/XRInteractable.ts:89
grabHands?XrGrabHandsHow many hands may hold it, and whether a second grab transfers it.components/XRInteractable.ts:91
twoHandRotation?XrTwoHandRotationWhether the second hand aims the object or only scales it.components/XRInteractable.ts:93
allowTwoHandScale?booleanLet a two-hand grab resize the object by moving the hands apart.components/XRInteractable.ts:95
minScale?numberSmallest fraction of its size a single scaling gesture may reach.components/XRInteractable.ts:97
maxScale?numberLargest multiple of its size a single scaling gesture may reach.components/XRInteractable.ts:99
attachPoints?XrAttachPoint[]Authored hand-holds. Empty means grab anywhere.components/XRInteractable.ts:101
applyVelocityOnRelease?booleanHand the object the velocity it was moving with when released.components/XRInteractable.ts:103
velocityScale?numberScales released velocity; >1 makes throws feel stronger than real life.components/XRInteractable.ts:105
hoverBehavior?XrHoverBehaviorFeedback shown while a pointer is on the object.components/XRInteractable.ts:107
hoverColor?stringOutline colour used by the color and both behaviours.components/XRInteractable.ts:109
hoverScale?numberSize multiplier used by the scale and both behaviours.components/XRInteractable.ts:111