@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / XrAttachPoint
Type Alias: XrAttachPoint ​
ts
type XrAttachPoint = {
id: string;
name: string;
position: {
x: number;
y: number;
z: number;
};
rotation: {
x: number;
y: number;
z: number;
};
hand: "left" | "right" | "any";
role: "primary" | "secondary" | "any";
};Defined in: components/XRInteractable.ts:40
A hand-hold authored on the object.
Without attach points a hand grabs wherever it happens to touch, which is right for a ball and wrong for a rifle — a weapon has a grip and a foregrip, and the hands belong on those exact spots. role is what lets an author say "this is the trigger hand's hold" so a two-hand grab assembles correctly no matter which hand arrives first.
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Stable id; referenced by scripts and by the inspector list. | components/XRInteractable.ts:42 |
name | string | - | components/XRInteractable.ts:43 |
position | { x: number; y: number; z: number; } | Object-local position of the hold (unscaled). | components/XRInteractable.ts:45 |
position.x | number | - | components/XRInteractable.ts:45 |
position.y | number | - | components/XRInteractable.ts:45 |
position.z | number | - | components/XRInteractable.ts:45 |
rotation | { x: number; y: number; z: number; } | Object-local orientation of the hold, radians. | components/XRInteractable.ts:47 |
rotation.x | number | - | components/XRInteractable.ts:47 |
rotation.y | number | - | components/XRInteractable.ts:47 |
rotation.z | number | - | components/XRInteractable.ts:47 |
hand | "left" | "right" | "any" | Restrict to one hand, or any. | components/XRInteractable.ts:49 |
role | "primary" | "secondary" | "any" | Whether this hold is the anchoring hand, the steering hand, or either. | components/XRInteractable.ts:51 |

