Skip to content

Variable: OneHandGrabbable

const OneHandGrabbable: Component<{ rotate: { default: true; type: Boolean; }; rotateMax: { default: [number, number, number]; type: Vec3; }; rotateMin: { default: [number, number, number]; type: Vec3; }; translate: { default: true; type: Boolean; }; translateMax: { default: [number, number, number]; type: Vec3; }; translateMin: { default: [number, number, number]; type: Vec3; }; }>

Defined in: packages/core/src/grab/one-hand-grabbable.ts:51

Component for enabling single‑hand object grabbing and manipulation.

Remarks

  • Allows users to grab and manipulate objects using a single VR controller or hand input.
  • Supports independent control of rotation and translation (movement) axes.
  • Rotation and translation can be constrained using min/max limits per axis.
  • Works with the GrabSystem to automatically create interaction handles.
  • Requires the entity to have an object3D for the interaction to work.

Examples

ts
entity.addComponent(OneHandGrabbable, {})
ts
entity.addComponent(OneHandGrabbable, {
  rotate: true,
  rotateMin: [0, -Math.PI, 0],
  rotateMax: [0, Math.PI, 0],
  translate: false
})
ts
entity.addComponent(OneHandGrabbable, {
  rotate: true,
  translate: true,
  translateMin: [-2, 0, -2],
  translateMax: [2, 3, 2]
})

See