![]() |
Murl Engine API
Version 2018.3
|
The IGameControllerDevice interface. More...
#include <murl_input_i_game_controller_device.h>
The IGameControllerDevice interface.
Public Member Functions | |
virtual Bool | IsConnected () const =0 |
Check if the controller device is connected. More... | |
virtual SInt32 | GetPlayerIndex () const =0 |
Get the player index. More... | |
virtual const IGameControllerMapping::DeviceInfo & | GetDeviceInfo () const =0 |
Get the device information. More... | |
virtual Bool | IsButtonAvailable (IEnums::GameControllerButton button) const =0 |
Check if a specified game controller button is available. More... | |
virtual Bool | IsButtonPressed (IEnums::GameControllerButton button) const =0 |
Check if a specified game controller button is pressed. More... | |
virtual Bool | WasButtonPressed (IEnums::GameControllerButton button) const =0 |
Check if a specified game controller button was pressed in the most recent tick. More... | |
virtual Bool | WasButtonReleased (IEnums::GameControllerButton button) const =0 |
Check if a specified game controller button was released in the most recent tick. More... | |
virtual Bool | IsControlAvailable (IEnums::GameControllerControl control) const =0 |
Check if a specified game controller control is available. More... | |
virtual Bool | GetShoulder (Float &value, IEnums::GameControllerControl control) const =0 |
Get the analog shoulder button value. More... | |
virtual Bool | GetGravity (AccelerationVector &gravity) const =0 |
Get the gravity axes values. More... | |
virtual Bool | GetAcceleration (AccelerationVector &acceleration) const =0 |
Get the acceleration axes values. More... | |
virtual Bool | GetStick (Float &xAxis, Float &yAxis, IEnums::GameControllerControl control) const =0 |
Get the analog stick axis values. More... | |
virtual Bool | SetTouchOrientationEnabled (Bool isEnabled)=0 |
Set the touchpad orientation enabled state. More... | |
virtual Bool | GetTouchOrientationEnabled (Bool &isEnabled) const =0 |
Get the touchpad orientation enabled state. More... | |
virtual Bool | SetTouchAbsoluteEnabled (Bool isEnabled)=0 |
Set the touchpad absolute enabled state. More... | |
virtual Bool | GetTouchAbsoluteEnabled (Bool &isEnabled) const =0 |
Get the touchpad absolute enabled state. More... | |
virtual Bool | SetVibration (Float intensity, IEnums::GameControllerControl control)=0 |
Set a vibration with a specified intensity. More... | |
virtual IGameControllerMappingPtr | GetMapping ()=0 |
Get the game controller mapping interface. More... | |
![]() | |
virtual const String & | GetName () const =0 |
Get the device name. More... | |
virtual UInt32 | GetId () const =0 |
Get the unique device identifier. More... | |
virtual Bool | HasUpdate () const =0 |
Check if the device has received new data since the last Update(). More... | |
virtual void | LogicUpdate ()=0 |
Is executed in the logic thread context each logic tick. | |
virtual void | ConfigChanged (const IAppConfiguration *appConfig)=0 |
Notification of changed configuration. More... | |
|
pure virtual |
Check if the controller device is connected.
If a controller is disconnected, the connected state changes to false and no more events are generated.
If another controller is connected, the controller device will be reconfigured and the connected state changes to true.
|
pure virtual |
Get the player index.
|
pure virtual |
Get the device information.
|
pure virtual |
Check if a specified game controller button is available.
button | The game controller button identifier. |
|
pure virtual |
Check if a specified game controller button is pressed.
button | The game controller button identifier. |
|
pure virtual |
Check if a specified game controller button was pressed in the most recent tick.
button | The game controller button identifier. |
|
pure virtual |
Check if a specified game controller button was released in the most recent tick.
button | The game controller button identifier. |
|
pure virtual |
Check if a specified game controller control is available.
control | The game controller control identifier. |
|
pure virtual |
Get the analog shoulder button value.
The return value is in range [0.0 not pressed .. 1.0 full pressed].
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_SHOULDER_L1, IEnums::GAME_CONTROLLER_CONTROL_SHOULDER_R1, IEnums::GAME_CONTROLLER_CONTROL_SHOULDER_L2 or IEnums::GAME_CONTROLLER_CONTROL_SHOULDER_R2.
value | The button return value. |
control | The game controller control identifier. |
|
pure virtual |
Get the gravity axes values.
Note that the total acceleration of the controller is equal to gravity plus acceleration.
The values are available if IsControlAvailable(IEnums::GAME_CONTROLLER_CONTROL_ACCELERATION).
gravity | The gravity axes return value in meter per seconds^2. |
|
pure virtual |
Get the acceleration axes values.
Note that the total acceleration of the controller is equal to gravity plus acceleration.
The values are available if IsControlAvailable(IEnums::GAME_CONTROLLER_CONTROL_ACCELERATION).
acceleration | The acceleration axes return value in meter per seconds^2. |
|
pure virtual |
Get the analog stick axis values.
The return values are in range [-1.0 bottom/left .. 1.0 top/right].
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_LEFT_STICK or IEnums::GAME_CONTROLLER_CONTROL_RIGHT_STICK.
xAxis | The x-axis return value. |
yAxis | The y-axis return value. |
control | The game controller control identifier. |
|
pure virtual |
Set the touchpad orientation enabled state.
The default value for this state is false, which means that the values of the touchpad are always determined based on the controller’s portrait orientation. If the state is set to true, then the touchpad values are calculated based on its current orientation, either landscape or portrait.
Supported control is IEnums::GAME_CONTROLLER_CONTROL_TOUCH_ORIENTATION.
isEnabled | The touchpad orientation enabled state. |
|
pure virtual |
Get the touchpad orientation enabled state.
isEnabled | The touchpad orientation enabled state return value. |
|
pure virtual |
Set the touchpad absolute enabled state.
The default value for this state is false, which means that the location where the user first touches the touchpad is assumed to be the neutral (0/0) value for the touchpad. All subsequent values are calculated relative to this position until the user lifts the finger. The next time the user’s finger touches the touchpad, a new origin is chosen. If this state is set to true, then all values are calculated relative to the physical center of the touchpad.
Supported control is IEnums::GAME_CONTROLLER_CONTROL_TOUCH_ABS_REL.
isEnabled | The touchpad absolute enabled state. |
|
pure virtual |
Get the touchpad absolute enabled state.
isEnabled | The touchpad absolute enabled state return value. |
|
pure virtual |
Set a vibration with a specified intensity.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_VIBRATE_LOW or IEnums::GAME_CONTROLLER_CONTROL_VIBRATE_HIGH.
intensity | The intensity of the vibration in range [0.0 none .. 1.0 full]. |
control | The game controller control identifier. |
|
pure virtual |
Get the game controller mapping interface.
Gamecontroller mapping is supported for USB HID game controller devices only, e.g. XBox controller or iOS controllers do not support mapping and return null.