Class PoseEnabledController
Hierarchy
- Gamepad
- PoseEnabledController
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Creates a new PoseEnabledController from a gamepad
Parameters
browserGamepad: any
the gamepad that the PoseEnabledController should be created from
Returns PoseEnabledController
Properties
browser GamepadSearch playground for browserGamepad
The browser gamepad
controller TypeSearch playground for controllerType
The type of controller (Eg. Windows mixed reality)
device PositionSearch playground for devicePosition
The device position in babylon space
device Rotation QuaternionSearch playground for deviceRotationQuaternion
The device rotation in babylon space
device Scale FactorSearch playground for deviceScaleFactor
The scale factor of the device in babylon space
idSearch playground for id
The id of the gamepad
indexSearch playground for index
The index of the gamepad
isXRSearch playground for isXR
If the controller is used in a webXR session
positionSearch playground for position
(Likely devicePosition should be used instead) The device position in its room space
raw PoseSearch playground for rawPose
The raw pose from the device
rotation QuaternionSearch playground for rotationQuaternion
(Likely deviceRotationQuaternion should be used instead) The device rotation in its room space
typeSearch playground for type
Specifies what type of gamepad this represents
Static DUALSHOCKSearch playground for DUALSHOCK
Represents an Dual Shock controller
Static GAMEPADSearch playground for GAMEPAD
Represents a gamepad controller
Static GENERICSearch playground for GENERIC
Represents a generic controller
Static Readonly POINTING_ POSESearch playground for 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
Represents a pose-enabled controller
Static XBOXSearch playground for XBOX
Represents an XBox controller
Accessors
is Connected
Specifies if the gamepad has been connected
Returns boolean
left Stick
Gets the left joystick
Returns StickValues
Sets the left joystick values
Parameters
newValues: StickValues
Returns void
mesh
The mesh that is attached to the controller
Returns Nullable<AbstractMesh>
right Stick
Gets the right joystick
Returns StickValues
Sets the right joystick value
Parameters
newValues: StickValues
Returns void
Methods
attach To MeshSearch playground for attachToMesh
Attaches a mesh to the controller
Parameters
mesh: AbstractMesh
the mesh to be attached
Returns void
attach To Pose Controlled CameraSearch 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
Disposes of the controller
Returns void
get Forward RaySearch playground for getForwardRay
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
Callback triggered when the left joystick has changed
Parameters
callback: ((values: StickValues) => void)
Parameters
values: StickValues
Returns void
Returns void
onrightstickchangedSearch playground for onrightstickchanged
Callback triggered when the right joystick has changed
Parameters
callback: ((values: StickValues) => void)
Parameters
values: StickValues
Returns void
Returns void
updateSearch playground for update
Updates the state of the pose enabled controller and mesh based on the current position and rotation of the controller
Returns void
update From DeviceSearch playground for updateFromDevice
Updates the state of the pose enbaled controller based on the raw pose data from the device
Parameters
poseData: DevicePose
raw pose fromthe device
Returns void
Defines the PoseEnabledController object that contains state of a vr capable controller