WebXRGenericTriggerMotionController | Babylon.js API documentation

API
Babylon.js API documentation
    Preparing search index...

    Class WebXRGenericTriggerMotionController

    A generic trigger-only motion controller for WebXR

    Hierarchy (View Summary)

    Index
    components: { [id: string]: WebXRControllerComponent } = {}

    A map of components (WebXRControllerComponent) in this motion controller Components have a ComponentType and can also have both button and axis definitions

    disableAnimation: boolean = false

    Disable the model's animation. Can be set at any time.

    The gamepad object correlating to this controller

    handedness (left/right/none) of this controller

    onModelLoadedObservable: Observable<WebXRAbstractMotionController> = ...

    Observers registered here will be triggered when the model of this controller is done loading

    profileId: string = WebXRGenericTriggerMotionController.ProfileId

    The profile id of this motion controller

    The root mesh of the model. It is null if the model was not yet initialized

    ProfileId: string = "generic-trigger"

    Static version of the profile id of this controller

    • Plays an advanced haptic effect on this controller.

      Parameters

      • effectType: GamepadHapticEffectType

        the standard Gamepad haptic effect to play

      • Optionalparameters: GamepadEffectParameters

        effect duration, delay, and motor magnitudes

      • hapticActuatorIndex: number = 0

        index of the actuator (usually 0)

      Returns Promise<GamepadHapticsResult>

      the native completion result from the actuator

      an Error when the actuator or requested effect is unsupported, or a RangeError when the actuator index is invalid

    Pulse (vibrate) this controller If the controller does not support pulses, this function will fail silently and return Promise directly after called Consecutive calls to this function will cancel the last pulse call

    Parameters

    • value: number

      the strength of the pulse in 0.0...1.0 range

    • duration: number

      Duration of the pulse in milliseconds

    • hapticActuatorIndex: number = 0

      optional index of actuator (will usually be 0)

    Returns Promise<boolean>

    a promise that will send true when the pulse has ended and false if the device doesn't support pulse or an error accrued