WindowsMotionController

Defines the WindowsMotionController object that the state of the windows motion controller

Hierarchy

Implements

Index

Constructors

constructor

Properties

browserGamepad

browserGamepad: any

The browser gamepad

controllerType

The type of controller (Eg. Windows mixed reality)

defaultModel

defaultModel: AbstractMesh

The default controller model for the controller

devicePosition

devicePosition: Vector3

The device position in babylon space

deviceRotationQuaternion

deviceRotationQuaternion: Quaternion

The device rotation in babylon space

deviceScaleFactor

deviceScaleFactor: number

The scale factor of the device in babylon space

hand

hand: string

id

id: string

The id of the gamepad

index

index: number

The index of the gamepad

isConnected

isConnected: boolean

Specifies if the gamepad has been connected

leftStick

leftStick: StickValues

Sets the left joystick values

mesh

The mesh that is attached to the controller

onGripButtonStateChangedObservable

onGripButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the grip button on this controller is modified

onMainButtonStateChangedObservable

onMainButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the main button state has changed

onMenuButtonStateChangedObservable

onMenuButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the menu button on this controller is modified

onPadStateChangedObservable

onPadStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the pad state has changed

onPadValuesChangedObservable

onPadValuesChangedObservable: Observable<StickValues>

Fired when controllers stick values have changed

onSecondaryButtonStateChangedObservable

onSecondaryButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the secondary button state has changed

onThumbstickButtonStateChangedObservable

onThumbstickButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the thumbstick button on this controller is modified

onTouchpadButtonStateChangedObservable

onTouchpadButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the touchpad button on this controller is modified

onTouchpadValuesChangedObservable

onTouchpadValuesChangedObservable: Observable<StickValues>

Fired when the touchpad values on this controller are modified

onTrackpadChangedObservable

onTrackpadChangedObservable: Observable<ExtendedGamepadButton>

Fired when the trackpad on this controller is clicked

onTrackpadValuesChangedObservable

onTrackpadValuesChangedObservable: Observable<StickValues>

Fired when the trackpad on this controller is modified

onTriggerButtonStateChangedObservable

onTriggerButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the trigger on this controller is modified

onTriggerStateChangedObservable

onTriggerStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the trigger state has changed

pad

X and Y axis corrisponding to the controllers joystick

position

position: Vector3

(Likely devicePosition should be used instead) The device position in its room space

rawPose

rawPose: DevicePose

The raw pose from the device

rightStick

rightStick: StickValues

Sets the right joystick value

rotationQuaternion

rotationQuaternion: Quaternion

(Likely deviceRotationQuaternion should be used instead) The device rotation in its room space

trackpad

trackpad: StickValues

The current x and y values of this controller's trackpad

type

type: number

Specifies what type of gamepad this represents

Static GAMEPAD

GAMEPAD: number

Represents a gamepad controller

Static GAMEPAD_ID_PREFIX

GAMEPAD_ID_PREFIX: string

The controller name prefix for this controller type

Static GENERIC

GENERIC: number

Represents a generic controller

Static MODEL_BASE_URL

MODEL_BASE_URL: string

The base url used to load the left and right controller models

Static MODEL_LEFT_FILENAME

MODEL_LEFT_FILENAME: string

The name of the left controller model file

Static MODEL_RIGHT_FILENAME

MODEL_RIGHT_FILENAME: string

The name of the right controller model file

Static POINTING_POSE

POINTING_POSE: string

Name of the child mesh that can be used to cast a ray from the controller

Static POSE_ENABLED

POSE_ENABLED: number

Represents a pose-enabled controller

Static XBOX

XBOX: number

Represents an XBox controller

Methods

attachToMesh

attachToPoseControlledCamera

dispose

  • dispose(): void

getForwardRay

  • getForwardRay(length?: number): Ray
  • Gets the ray of the controller in the direction the controller is pointing

    Parameters

    • Optional length: number

      the length the resulting ray should be

    Returns Ray

    a ray in the direction the controller is pointing

initControllerMesh

  • initControllerMesh(scene: Scene, meshLoaded?: function, forceDefault?: boolean): void
  • Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.

    Parameters

    • scene: Scene

      scene in which to add meshes

    • Optional meshLoaded: function

      optional callback function that will be called if the mesh loads successfully.

    • Optional forceDefault: boolean

    Returns void

onButtonStateChange

  • onButtonStateChange(callback: function): void
  • Fired when a controller button's state has changed

    Parameters

    • callback: function

      the callback containing the button that was modified

        • (controlledIndex: number, buttonIndex: number, state: ExtendedGamepadButton): void
        • Parameters

          • controlledIndex: number
          • buttonIndex: number
          • state: ExtendedGamepadButton

          Returns void

    Returns void

onleftstickchanged

  • onleftstickchanged(callback: function): void
  • Callback triggered when the left joystick has changed

    Parameters

    Returns void

onrightstickchanged

  • onrightstickchanged(callback: function): void
  • Callback triggered when the right joystick has changed

    Parameters

    Returns void

update

  • update(): void
  • Called once per frame by the engine.

    Returns void

updateFromDevice

Generated using TypeDoc