OneHandGrabbable uses one direct input. It supports translation and rotation but not scale.entity.addComponent(OneHandGrabbable, {
rotate: true,
translate: true,
rotateMin: [-Math.PI / 4, -Math.PI, -Math.PI / 4],
rotateMax: [Math.PI / 4, Math.PI, Math.PI / 4],
});
multitouch: false and denies ray pointer events for
the handle’s lifetime, from component initialization until the grab component
is removed.TwoHandsGrabbable supports translation, rotation, and scale from two direct inputs.entity.addComponent(TwoHandsGrabbable, {
rotate: true,
translate: true,
scale: true,
scaleMin: [0.5, 0.5, 0.5],
scaleMax: [2, 2, 2],
});
multitouch: true and denies ray pointer events. Use it when an object needs two-input positioning or resizing.DistanceGrabbable accepts ray input and denies grab-pointer events. Its four movement modes are:MovementMode.MoveFromTarget; MovementMode.MoveTowardsTarget; MovementMode.MoveAtSource; MovementMode.RotateAtSource;
MoveFromTarget uses projected-ray handle movement.MoveTowardsTarget interpolates toward the pointer origin plus configured position and quaternion offsets.MoveAtSource applies the pointer origin’s frame-to-frame delta.RotateAtSource rotates the object without translation or scale.0.005 world units. Configure its speed with moveSpeedFactor.entity.addComponent(DistanceGrabbable, {
movementMode: MovementMode.MoveTowardsTarget,
moveSpeedFactor: 0.15,
targetPositionOffset: [0, 0, -0.25],
});
| Grab type | Pointer used | Pointer type denied while the handle exists |
|---|---|---|
One hand | Direct grab | Ray |
Two hands | Direct grab | Ray |
Distance | Ray | Grab |
RotateAtSource for a fixed-position dial or valve.