API

Interface IWebXRControllerMovementOptions

The options container for the controller movement module

interface IWebXRControllerMovementOptions {
    customRegistrationConfigurations?: WebXRControllerMovementRegistrationConfiguration[];
    movementEnabled?: boolean;
    movementOrientationFollowsController: boolean;
    movementOrientationFollowsViewerPose: boolean;
    movementSpeed?: number;
    movementThreshold?: number;
    orientationPreferredHandedness?: any;
    rotationEnabled?: boolean;
    rotationSpeed?: number;
    rotationThreshold?: number;
    xrInput: WebXRInput;
}
Index
customRegistrationConfigurations?: WebXRControllerMovementRegistrationConfiguration[]

Override default behaviour and provide your own movement controls

movementEnabled?: boolean

Is movement enabled

movementOrientationFollowsController: boolean

If movement orientation should follow controller orientation instead of viewer pose. Make sure to set movementOrientationFollowsViewerPose to false, otherwise it will be ignored.

movementOrientationFollowsViewerPose: boolean

Camera direction follows view pose and movement by default will move independently of the viewer's pose.

movementSpeed?: number

Movement speed factor (default is 1.0)

movementThreshold?: number

Minimum threshold the controller's thumbstick/touchpad must pass before being recognized for movement (avoids jitter/unintentional movement)

orientationPreferredHandedness?: any

If orientation follows the controller, this is the preferred handedness to use for forward movement. If not set (or handedness not found), the handedness will be selected by the controller triggering the movement. Note that this only works if movementOrientationFollowsController is true.

rotationEnabled?: boolean

Is rotation enabled

rotationSpeed?: number

Movement speed factor (default is 1.0)

rotationThreshold?: number

Minimum threshold the controller's thumstick/touchpad must pass before being recognized for rotation (avoids jitter/unintentional rotation)

xrInput: WebXRInput

Babylon XR Input class for controller