new Gamepad(viewer, ref)
Gamepads manager that handles gamepads
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | FORGE.Viewer reference. |
ref |
Gamepad | the reference to the Gamepad object. |
- Source:
Extends
Members
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
enabled :boolean
Gets or sets the enabled status of the gamepad.
Type:
- boolean
- Source:
gamepad :Gamepad
Gets the raw data of the gamepad (the Gamepad object, not the FORGE one).
Type:
- Gamepad
- Source:
(readonly) hand :string
Gets the hand of the gamepad if any.
Type:
- string
- Source:
(readonly) mapping :string
Gets the mapping of the gamepad.
Type:
- string
- Source:
(readonly) name :string
Gets the name of the gamepad.
Type:
- string
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) position :GamepadPose
Gets the position of the gamepad, relative to the camera.
Type:
- GamepadPose
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
_getAxisBindings(index) → {Array.<FORGE.AxisBinding>}
Get an array of bindings associated to the axis.
Parameters:
Name | Type | Description |
---|---|---|
index |
number | the index of the axis |
- Source:
Returns:
an array of bindings
- Type
- Array.<FORGE.AxisBinding>
_getButtonBindings(index) → {Array.<FORGE.ButtonBinding>}
Get an array of bindings associated to the button.
Parameters:
Name | Type | Description |
---|---|---|
index |
number | the index of the button |
- Source:
Returns:
an array of bindings
- Type
- Array.<FORGE.ButtonBinding>
addBinding(binding) → {boolean}
Add a BaseBinding to the Gamepad's correct bindings array.
Parameters:
Name | Type | Description |
---|---|---|
binding |
FORGE.BaseBinding | The FORGE.BaseBinding you want to add. |
- Source:
Returns:
Returns true if it's correctly added, false if it's already in or if wrong type.
- Type
- boolean
destroy()
Destroy sequence.
- Overrides:
- Source:
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
removeBinding(binding) → {boolean}
Remove a BaseBinding of the Gamepad.
Parameters:
Name | Type | Description |
---|---|---|
binding |
FORGE.BaseBinding | The binding to remove. |
- Source:
Returns:
Returns true if it's removed, false if not found.
- Type
- boolean
update()
Update routine.
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: