WindowsMotionController

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

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground

Properties

browserGamepad

Find examples in Playground
browserGamepad: any

The browser gamepad

controllerType

Find examples in Playground

The type of controller (Eg. Windows mixed reality)

defaultModel

Find examples in Playground
defaultModel: AbstractMesh

The default controller model for the controller

devicePosition

Find examples in Playground
devicePosition: Vector3

The device position in babylon space

deviceRotationQuaternion

Find examples in Playground
deviceRotationQuaternion: Quaternion

The device rotation in babylon space

deviceScaleFactor

Find examples in Playground
deviceScaleFactor: number

The scale factor of the device in babylon space

hand

Find examples in Playground
hand: string

id

Find examples in Playground
id: string

The id of the gamepad

index

Find examples in Playground
index: number

The index of the gamepad

isConnected

Find examples in Playground
isConnected: boolean

Specifies if the gamepad has been connected

leftStick

Find examples in Playground
leftStick: StickValues

Sets the left joystick values

mesh

Find examples in Playground

The mesh that is attached to the controller

onGripButtonStateChangedObservable

Find examples in Playground
onGripButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the grip button on this controller is modified

onMainButtonStateChangedObservable

Find examples in Playground
onMainButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the main button state has changed

onMenuButtonStateChangedObservable

Find examples in Playground
onMenuButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the menu button on this controller is modified

onPadStateChangedObservable

Find examples in Playground
onPadStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the pad state has changed

onPadValuesChangedObservable

Find examples in Playground
onPadValuesChangedObservable: Observable<StickValues>

Fired when controllers stick values have changed

onSecondaryButtonStateChangedObservable

Find examples in Playground
onSecondaryButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the secondary button state has changed

onThumbstickButtonStateChangedObservable

Find examples in Playground
onThumbstickButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the thumbstick button on this controller is modified

onTouchpadButtonStateChangedObservable

Find examples in Playground
onTouchpadButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the touchpad button on this controller is modified

onTouchpadValuesChangedObservable

Find examples in Playground
onTouchpadValuesChangedObservable: Observable<StickValues>

Fired when the touchpad values on this controller are modified

onTrackpadChangedObservable

Find examples in Playground
onTrackpadChangedObservable: Observable<ExtendedGamepadButton>

Fired when the trackpad on this controller is clicked

onTrackpadValuesChangedObservable

Find examples in Playground
onTrackpadValuesChangedObservable: Observable<StickValues>

Fired when the trackpad on this controller is modified

onTriggerButtonStateChangedObservable

Find examples in Playground
onTriggerButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the trigger on this controller is modified

onTriggerStateChangedObservable

Find examples in Playground
onTriggerStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the trigger state has changed

pad

Find examples in Playground

X and Y axis corrisponding to the controllers joystick

position

Find examples in Playground
position: Vector3

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

rawPose

Find examples in Playground
rawPose: DevicePose

The raw pose from the device

rightStick

Find examples in Playground
rightStick: StickValues

Sets the right joystick value

rotationQuaternion

Find examples in Playground
rotationQuaternion: Quaternion

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

trackpad

Find examples in Playground
trackpad: StickValues

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

type

Find examples in Playground
type: number

Specifies what type of gamepad this represents

Static GAMEPAD

Find examples in Playground
GAMEPAD: number

Represents a gamepad controller

Static GAMEPAD_ID_PREFIX

Find examples in Playground
GAMEPAD_ID_PREFIX: string

The controller name prefix for this controller type

Static GENERIC

Find examples in Playground
GENERIC: number

Represents a generic controller

Static MODEL_BASE_URL

Find examples in Playground
MODEL_BASE_URL: string

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

Static MODEL_LEFT_FILENAME

Find examples in Playground
MODEL_LEFT_FILENAME: string

The name of the left controller model file

Static MODEL_RIGHT_FILENAME

Find examples in Playground
MODEL_RIGHT_FILENAME: string

The name of the right controller model file

Static POINTING_POSE

Find examples in Playground
POINTING_POSE: string

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

Static POSE_ENABLED

Find examples in Playground
POSE_ENABLED: number

Represents a pose-enabled controller

Static XBOX

Find examples in Playground
XBOX: number

Represents an XBox controller

Methods

attachToMesh

Find examples in Playground

attachToPoseControlledCamera

Find examples in Playground

dispose

Find examples in Playground
  • dispose(): void

getForwardRay

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • onleftstickchanged(callback: function): void

onrightstickchanged

Find examples in Playground
  • onrightstickchanged(callback: function): void

update

Find examples in Playground
  • update(): void

updateFromDevice

Find examples in Playground

Generated using TypeDoc