TwinStickInputSystem Class
Input component for twin-stick gamepad control schemes. More...
Declaration
Base class
| class | System |
|
Abstract base class for game systems. More... | |
Public Constructors Index
| TwinStickInputSystem (helios::engine::ecs::GameObject gameObject) | |
|
Constructs a TwinStickInputSystem for the specified GameObject. More... | |
Public Member Functions Index
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) noexcept override |
|
Processes gamepad input and generates movement/aiming commands. More... | |
| void | setUseDedicatedShootInput (bool useDedicatedInput) noexcept |
|
Enables or disables dedicated shoot input mode. More... | |
| bool | useDedicatedShootInput () const noexcept |
|
Returns whether dedicated shoot input mode is enabled. More... | |
Private Member Attributes Index
| bool | useDedicatedShootInput_ = false |
|
Flag to indicate whether shoot commands should be derived from the aim component. More... | |
| helios::engine::ecs::GameObject | gameObject_ |
|
Reference to the GameObject this system reads input for. More... | |
Description
Input component for twin-stick gamepad control schemes.
Translates gamepad analog stick input into movement and aiming commands. The left stick controls movement direction and speed, while the right stick controls aiming direction and intensity.
Each frame, this component reads the current input snapshot and generates Move2DCommand, SteeringCommand and Aim2DCommand instances that are queued in the CommandBuffer for later execution.
Requires the owning GameObject to have Move2DComponent and Aim2DComponent attached for the generated commands to have any effect.
Definition at line 39 of file TwinStickInputSystem.ixx.
Public Constructors
TwinStickInputSystem()
| inline explicit |
Constructs a TwinStickInputSystem for the specified GameObject.
- Parameters
-
gameObject Reference to the GameObject to generate input commands for.
Definition at line 61 of file TwinStickInputSystem.ixx.
Public Member Functions
setUseDedicatedShootInput()
| inline noexcept |
Enables or disables dedicated shoot input mode.
- Parameters
-
useDedicatedInput If true, ShootCommands use the right trigger. If false, the aim stick magnitude is used.
Definition at line 137 of file TwinStickInputSystem.ixx.
update()
| inline noexcept virtual |
Processes gamepad input and generates movement/aiming commands.
- Parameters
-
updateContext Context containing input snapshot and command buffer.
Definition at line 69 of file TwinStickInputSystem.ixx.
Reference helios::math::EPSILON_LENGTH.
useDedicatedShootInput()
| inline nodiscard noexcept |
Returns whether dedicated shoot input mode is enabled.
- Returns
True if ShootCommands use the right trigger, false if aim magnitude is used.
Definition at line 146 of file TwinStickInputSystem.ixx.
Private Member Attributes
gameObject_
|
Reference to the GameObject this system reads input for.
Definition at line 52 of file TwinStickInputSystem.ixx.
useDedicatedShootInput_
|
Flag to indicate whether shoot commands should be derived from the aim component.
If true, ShootCommands will be created from dedicated input.
Definition at line 47 of file TwinStickInputSystem.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.