Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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

browserGamepadSearch playground for browserGamepad

browserGamepad: any

The browser gamepad

controllerTypeSearch playground for controllerType

The type of controller (Eg. Windows mixed reality)

devicePositionSearch playground for devicePosition

devicePosition: Vector3

The device position in babylon space

deviceRotationQuaternionSearch playground for deviceRotationQuaternion

deviceRotationQuaternion: Quaternion

The device rotation in babylon space

deviceScaleFactorSearch playground for deviceScaleFactor

deviceScaleFactor: number

The scale factor of the device in babylon space

idSearch playground for id

id: string

The id of the gamepad

indexSearch playground for index

index: number

The index of the gamepad

isXRSearch playground for isXR

isXR: boolean

If the controller is used in a webXR session

positionSearch playground for position

position: Vector3

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

rawPoseSearch playground for rawPose

rawPose: DevicePose

The raw pose from the device

rotationQuaternionSearch playground for rotationQuaternion

rotationQuaternion: Quaternion

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

typeSearch playground for type

type: number

Specifies what type of gamepad this represents

Static DUALSHOCKSearch playground for DUALSHOCK

DUALSHOCK: number

Represents an Dual Shock controller

Static GAMEPADSearch playground for GAMEPAD

GAMEPAD: number

Represents a gamepad controller

Static GENERICSearch playground for GENERIC

GENERIC: number

Represents a generic controller

Static Readonly POINTING_POSESearch playground for POINTING_POSE

POINTING_POSE: "POINTING_POSE" = "POINTING_POSE"

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

Static POSE_ENABLEDSearch playground for POSE_ENABLED

POSE_ENABLED: number

Represents a pose-enabled controller

Static XBOXSearch playground for XBOX

XBOX: number

Represents an XBox controller

Accessors

isConnected

  • get isConnected(): boolean
  • Specifies if the gamepad has been connected

    Returns boolean

leftStick

mesh

  • The mesh that is attached to the controller

    Returns Nullable<AbstractMesh>

rightStick

Methods

attachToMeshSearch playground for attachToMesh

  • Attaches a mesh to the controller

    Parameters

    Returns void

attachToPoseControlledCameraSearch playground for attachToPoseControlledCamera

  • Attaches the controllers mesh to a camera

    Parameters

    • camera: TargetCamera

      the camera the mesh should be attached to

    Returns void

disposeSearch playground for dispose

  • dispose(): void
  • Disposes of the controller

    Returns void

getForwardRaySearch playground for 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

onleftstickchangedSearch playground for onleftstickchanged

  • onleftstickchanged(callback: (values: StickValues) => void): void

onrightstickchangedSearch playground for onrightstickchanged

  • onrightstickchanged(callback: (values: StickValues) => void): void

updateSearch playground for update

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

    Returns void

updateFromDeviceSearch playground for updateFromDevice

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

    Parameters

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method