@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 ​
| Property | Type | Description | Defined 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? | number | Metres 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.x | number | - | components/XRInteractable.ts:87 |
grabOffsetPosition.y | number | - | components/XRInteractable.ts:87 |
grabOffsetPosition.z | number | - | components/XRInteractable.ts:87 |
grabOffsetRotation? | { x: number; y: number; z: number; } | Orientation offset, in radians. | components/XRInteractable.ts:89 |
grabOffsetRotation.x | number | - | components/XRInteractable.ts:89 |
grabOffsetRotation.y | number | - | components/XRInteractable.ts:89 |
grabOffsetRotation.z | number | - | components/XRInteractable.ts:89 |
grabHands? | XrGrabHands | How many hands may hold it, and whether a second grab transfers it. | components/XRInteractable.ts:91 |
twoHandRotation? | XrTwoHandRotation | Whether the second hand aims the object or only scales it. | components/XRInteractable.ts:93 |
allowTwoHandScale? | boolean | Let a two-hand grab resize the object by moving the hands apart. | components/XRInteractable.ts:95 |
minScale? | number | Smallest fraction of its size a single scaling gesture may reach. | components/XRInteractable.ts:97 |
maxScale? | number | Largest 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? | boolean | Hand the object the velocity it was moving with when released. | components/XRInteractable.ts:103 |
velocityScale? | number | Scales released velocity; >1 makes throws feel stronger than real life. | components/XRInteractable.ts:105 |
hoverBehavior? | XrHoverBehavior | Feedback shown while a pointer is on the object. | components/XRInteractable.ts:107 |
hoverColor? | string | Outline colour used by the color and both behaviours. | components/XRInteractable.ts:109 |
hoverScale? | number | Size multiplier used by the scale and both behaviours. | components/XRInteractable.ts:111 |

