API

Interface IMinimalMotionControllerObject

The elements needed for change-detection of the gamepad objects in motion controllers

interface IMinimalMotionControllerObject {
    axes: number[];
    buttons: { pressed: boolean; touched: boolean; value: number }[];
    hapticActuators?: (
        IWebXRControllerHapticActuator & {
            pulse: (value: number, duration: number) => Promise<boolean>;
        }
    )[];
    vibrationActuator?: IWebXRControllerHapticActuator;
}
Index
axes: number[]

Available axes of this controller

buttons: { pressed: boolean; touched: boolean; value: number }[]

An array of available buttons

Type Declaration

  • pressed: boolean

    If the button/trigger is currently pressed

  • touched: boolean

    If the button/trigger is currently touched

  • value: number

    Value of the button/trigger

hapticActuators?: (
    IWebXRControllerHapticActuator & {
        pulse: (value: number, duration: number) => Promise<boolean>;
    }
)[]

EXPERIMENTAL haptic support.

Type Declaration

  • pulse: (value: number, duration: number) => Promise<boolean>

    Plays a legacy haptic pulse.

vibrationActuator?: IWebXRControllerHapticActuator

The primary Gamepad vibration actuator used for advanced haptic effects.