PoseEnabledController

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

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground
  • Creates a new PoseEnabledController from a gamepad

    Parameters

    • browserGamepad: any

      the gamepad that the PoseEnabledController should be created from

    Returns PoseEnabledController

Properties

browserGamepad

Find examples in Playground
browserGamepad: any

The browser gamepad

controllerType

Find examples in Playground

The type of controller (Eg. Windows mixed reality)

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

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

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

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 GENERIC

Find examples in Playground
GENERIC: number

Represents a generic controller

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
  • Attaches a mesh to the controller

    Parameters

    Returns void

attachToPoseControlledCamera

Find examples in Playground
  • Attaches the controllers mesh to a camera

    Parameters

    • camera: TargetCamera

      the camera the mesh should be attached to

    Returns void

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

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
  • Updates the state of the pose enbaled controller and mesh based on the current position and rotation of the controller

    Returns void

updateFromDevice

Find examples in Playground
  • Updates the state of the pose enbaled controller based on the raw pose data from the device

    Parameters

    Returns void

Generated using TypeDoc