GearVRController

Gear VR Controller

Hierarchy

Implements

Index

Constructors

constructor

Properties

browserGamepad

browserGamepad: any

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

index

index: number

isConnected

isConnected: boolean

leftStick

leftStick: StickValues

mesh

The mesh that is attached to the controller

onMainButtonStateChangedObservable

onMainButtonStateChangedObservable: Observable<ExtendedGamepadButton>

Fired when the main button state has changed

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

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

rotationQuaternion

rotationQuaternion: Quaternion

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

type

type: number

Static GAMEPAD

GAMEPAD: number

Static GAMEPAD_ID_PREFIX

GAMEPAD_ID_PREFIX: string

Gamepad Id prefix used to identify this controller.

Static GENERIC

GENERIC: number

Static MODEL_BASE_URL

MODEL_BASE_URL: string

Base Url for the controller model.

Static MODEL_FILENAME

MODEL_FILENAME: string

File name for the controller model.

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

Static XBOX

XBOX: number

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): 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.

    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

onrightstickchanged

  • onrightstickchanged(callback: function): void

update

  • update(): void

updateFromDevice

Generated using TypeDoc