Class WebXRControllerComponent
Hierarchy
- WebXRControllerComponent
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates a new component for a motion controller. It is created by the motion controller itself
Parameters
-
id: string
the id of this component
-
type: MotionControllerComponentType
the type of the component
-
Optional _buttonIndex: number
index in the buttons array of the gamepad
-
Optional _axesIndices: number[]
indices of the values in the axes array of the gamepad
Returns WebXRControllerComponent
-
Properties
idSearch playground for id
the id of this component
on Axis Value Changed ObservableSearch playground for onAxisValueChangedObservable
If axes are available for this component (like a touchpad or thumbstick) the observers will be notified when the axes data changes
on Button State Changed ObservableSearch playground for onButtonStateChangedObservable
Observers registered here will be triggered when the state of a button changes State change is either pressed / touched / value
typeSearch playground for type
the type of the component
Static BUTTON_ TYPESearch playground for BUTTON_TYPE
button component type
Static SQUEEZE_ TYPESearch playground for SQUEEZE_TYPE
squeeze component type
Static THUMBSTICK_ TYPESearch playground for THUMBSTICK_TYPE
Thumbstick component type
Static TOUCHPAD_ TYPESearch playground for TOUCHPAD_TYPE
Touchpad component type
Static TRIGGER_ TYPESearch playground for TRIGGER_TYPE
trigger component type
Accessors
axes
-
The current axes data. If this component has no axes it will still return an object { x: 0, y: 0 }
Returns IWebXRMotionControllerAxesValue
changes
-
Get the changes. Elements will be populated only if they changed with their previous and current value
Returns IWebXRMotionControllerComponentChanges
has Changes
-
Return whether or not the component changed the last frame
Returns boolean
pressed
-
is the button currently pressed
Returns boolean
touched
-
is the button currently touched
Returns boolean
value
-
Get the current value of this component
Returns number
Methods
disposeSearch playground for dispose
-
Dispose this component
Returns void
is AxesSearch playground for isAxes
-
Are there axes correlating to this component
Returns boolean
true is axes data is available
is ButtonSearch playground for isButton
-
Is this component a button (hence - pressable)
Returns boolean
true if can be pressed
updateSearch playground for update
-
update this component using the gamepad object it is in. Called on every frame
Parameters
-
nativeController: IMinimalMotionControllerObject
the native gamepad controller object
Returns void
-
This class represents a single component (for example button or thumbstick) of a motion controller