useXRControllerLocomotion
useXRControllerLocomotion(
target
,translationOptions
,rotationOptions
,translationControllerHand
):void
A hook for handling basic locomotion in VR
Parameters
targetEither a THREE.Group
ref, or a callback function. Recieves movement input (required).
RefObject
<null
| Object3D
<Object3DEventMap
>> | (velocity
, rotationVelocityY
, deltaTime
, state
, frame?
) => void
XRControllerLocomotionTranslationOptions
= {}
Options that control the translation of the user. Set to false
to disable.
The speed at which the user moves.
rotationOptionsXRControllerLocomotionRotationOptions
= {}
Options that control the rotation of the user. Set to false
to disable.
How far the joystick must be pushed to trigger a turn.
rotationOptions.typeControls how rotation using the controller functions. Can be either 'smooth' or 'snap'.
rotationOptions.degreesIf type
is 'snap', this specifies the number of degrees to snap the user's view by.
If type
is 'smooth', this specifies the speed at which the user's view rotates.
Specifies which hand will control the movement. Can be either 'left' or 'right'.
"left"
| "right"
Returns
void