@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / XRInteractableComponent
Class: XRInteractableComponent ​
Defined in: components/XRInteractable.ts:123
Makes an entity respond to XR pointers and hands.
Split into pointable and grabbable because they are different affordances: a wall panel should receive select events without being liftable, while a physics prop should be both.
Extends ​
Constructors ​
Constructor ​
ts
new XRInteractableComponent(options?): XRInteractableComponent;Defined in: components/XRInteractable.ts:168
Parameters ​
| Parameter | Type |
|---|---|
options? | XRInteractableOptions |
Returns ​
XRInteractableComponent
Overrides ​
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled | boolean | - | components/XRInteractable.ts:124 |
grabbable | boolean | - | components/XRInteractable.ts:125 |
pointable | boolean | - | components/XRInteractable.ts:126 |
grabReach | XrGrabReach | Whether the object can be grabbed up close, at range, or either. | components/XRInteractable.ts:128 |
distanceBehavior | XrDistanceGrabBehavior | What a distance grab does — bring it here, or manipulate it in place. | components/XRInteractable.ts:130 |
grabGesture | XrGrabGesture | Which gesture grabs it. | components/XRInteractable.ts:132 |
grabRadius | number | Metres within which a physical grab registers. | components/XRInteractable.ts:134 |
grabOffsetPosition | { x: number; y: number; z: number; } | Position offset from the hand while held. | components/XRInteractable.ts:136 |
grabOffsetPosition.x | number | - | components/XRInteractable.ts:136 |
grabOffsetPosition.y | number | - | components/XRInteractable.ts:136 |
grabOffsetPosition.z | number | - | components/XRInteractable.ts:136 |
grabOffsetRotation | { x: number; y: number; z: number; } | Rotation offset (radians) while held. | components/XRInteractable.ts:138 |
grabOffsetRotation.x | number | - | components/XRInteractable.ts:138 |
grabOffsetRotation.y | number | - | components/XRInteractable.ts:138 |
grabOffsetRotation.z | number | - | components/XRInteractable.ts:138 |
grabHands | XrGrabHands | How many hands may hold it, and whether a second grab transfers it. | components/XRInteractable.ts:140 |
twoHandRotation | XrTwoHandRotation | Whether the second hand aims the object or only scales it. | components/XRInteractable.ts:142 |
allowTwoHandScale | boolean | Whether a two-hand grab may resize the object. | components/XRInteractable.ts:144 |
minScale | number | Scale floor for one gesture, as a fraction of the size at grab time. | components/XRInteractable.ts:146 |
maxScale | number | Scale ceiling for one gesture, as a multiple of the size at grab time. | components/XRInteractable.ts:148 |
attachPoints | XrAttachPoint[] | Authored hand-holds; empty means grab anywhere. | components/XRInteractable.ts:150 |
applyVelocityOnRelease | boolean | Hand the object the velocity it was moving with when released. Applies to every release, not just a deliberate throw — letting go while your hand drifts should nudge the object, which is why this is not called "throw". | components/XRInteractable.ts:158 |
velocityScale | number | Multiplier on released velocity. | components/XRInteractable.ts:160 |
hoverBehavior | XrHoverBehavior | Feedback shown while a pointer is on the object. | components/XRInteractable.ts:162 |
hoverColor | string | Outline colour for the color and both behaviours. | components/XRInteractable.ts:164 |
hoverScale | number | Size multiplier for the scale and both behaviours. | components/XRInteractable.ts:166 |

