Creates a new GenericController from a gamepad
the gamepad that the controller should be created from
The browser gamepad
The type of controller (Eg. Windows mixed reality)
The default controller model for the controller
The device position in babylon space
The device rotation in babylon space
The scale factor of the device in babylon space
'left' or 'right', see https://w3c.github.io/gamepad/extensions.html#gamepadhand-enum
The id of the gamepad
The index of the gamepad
Specifies if the gamepad has been connected
If the controller is used in a webXR session
Sets the left joystick values
The mesh that is attached to the controller
Fired when the main button state has changed
Fired when the pad state has changed
Fired when controllers stick values have changed
Fired when the secondary button state has changed
Fired when the trigger state has changed
X and Y axis corresponding to the controllers joystick
(Likely devicePosition should be used instead) The device position in its room space
The raw pose from the device
Sets the right joystick value
(Likely deviceRotationQuaternion should be used instead) The device rotation in its room space
Specifies what type of gamepad this represents
Represents an Dual Shock controller
Represents a gamepad controller
Represents a generic controller
Base Url for the controller model.
File name for the controller model.
Name of the child mesh that can be used to cast a ray from the controller
Represents a pose-enabled controller
Represents an XBox controller
Attaches a mesh to the controller
the mesh to be attached
Attaches the controllers mesh to a camera
the camera the mesh should be attached to
Disposes of th webVRCOntroller
Gets the ray of the controller in the direction the controller is pointing
the length the resulting ray should be
a ray in the direction the controller is pointing
Implements abstract method on WebVRController class, loading controller meshes and calling this.attachToMesh if successful.
scene in which to add meshes
optional callback function that will be called if the mesh loads successfully.
Fired when a controller button's state has changed
the callback containing the button that was modified
Callback triggered when the left joystick has changed
Callback triggered when the right joystick has changed
Updates the state of the controller and mesh based on the current position and rotation of the controller
Updates the state of the pose enbaled controller based on the raw pose data from the device
raw pose fromthe device
Generated using TypeDoc
Generic Controller