WebXRHTCViveMotionController

The motion controller class for the standard HTC-Vive controllers

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground

Properties

Readonly components

Find examples in Playground
components: object

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

Type declaration

disableAnimation

Find examples in Playground
disableAnimation: boolean

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

gamepadObject

Find examples in Playground

The gamepad object correlating to this controller

handedness

Find examples in Playground

handedness (left/right/none) of this controller

onModelLoadedObservable

Find examples in Playground
onModelLoadedObservable: Observable<WebXRAbstractMotionController>

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

profileId

Find examples in Playground
profileId: string

rootMesh

Find examples in Playground

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

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_FILENAME

Find examples in Playground
MODEL_FILENAME: string

File name for the controller model.

Accessors

handness

Find examples in Playground

Methods

dispose

Find examples in Playground
  • dispose(): void

getAllComponentsOfType

Find examples in Playground

getComponent

Find examples in Playground

getComponentIds

Find examples in Playground
  • getComponentIds(): string[]

getComponentOfType

Find examples in Playground

getMainComponent

Find examples in Playground

loadModel

Find examples in Playground
  • loadModel(): Promise<boolean>
  • Loads the model correlating to this controller When the mesh is loaded, the onModelLoadedObservable will be triggered

    Returns Promise<boolean>

    A promise fulfilled with the result of the model loading

pulse

Find examples in Playground
  • pulse(value: number, duration: number, hapticActuatorIndex?: number): Promise<boolean>
  • 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

    • Optional hapticActuatorIndex: number

      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

updateFromXRFrame

Find examples in Playground
  • updateFromXRFrame(xrFrame: XRFrame): void

Generated using TypeDoc