PoseEnabledController

Defines the PoseEnabledController object that contains state of a vr capable controller

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a new PoseEnabledController from a gamepad

    Parameters

    • browserGamepad: any

      the gamepad that the PoseEnabledController should be created from

    Returns PoseEnabledController

Properties

browserGamepad

browserGamepad: any

controllerType

The type of controller (Eg. Windows mixed reality)

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

id

id: string

index

index: number

isConnected

isConnected: boolean

leftStick

leftStick: StickValues

mesh

The mesh that is attached to the controller

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 GENERIC

GENERIC: number

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

  • Attaches a mesh to the controller

    Parameters

    Returns void

attachToPoseControlledCamera

  • Attaches the controllers mesh to a camera

    Parameters

    • camera: TargetCamera

      the camera the mesh should be attached to

    Returns void

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

onleftstickchanged

  • onleftstickchanged(callback: function): void

onrightstickchanged

  • onrightstickchanged(callback: function): void

update

  • update(): void
  • Updates the state of the pose enbaled controller and mesh based on the current position and rotation of the controller

    Returns void

updateFromDevice

  • Updates the state of the pose enbaled controller based on the raw pose data from the device

    Parameters

    Returns void

Generated using TypeDoc