Aim2DCommand Class
Command that applies 2D aiming direction to a GameObject. More...
Declaration
Base class
| class | TargetedCommand |
|
Abstract base class for commands targeting a specific GameObject. More... | |
Public Constructors Index
| Aim2DCommand (const helios::math::vec2f direction, const float freqFactor) | |
|
Constructs an aim command with direction and frequency. More... | |
Public Member Functions Index
| void | execute (helios::engine::ecs::GameObject &gameObject) const noexcept override |
|
Executes the aim command on a GameObject. More... | |
Private Member Attributes Index
| const float | freqFactor_ |
|
The analog stick magnitude determining fire frequency. More... | |
| const helios::math::vec2f | direction_ |
|
The normalized direction vector for aiming. More... | |
Description
Command that applies 2D aiming direction to a GameObject.
This command encapsulates an aim request consisting of a normalized direction vector and a frequency factor derived from analog stick magnitude. When executed, it invokes Aim2DComponent::aim() to update the aiming direction and fire frequency.
The target GameObject must have an Aim2DComponent attached for this command to have any effect.
- See Also
helios::engine::runtime::messaging::command::Command
- See Also
helios::engine::mechanics::components::Aim2DComponent
Definition at line 30 of file Aim2DCommand.ixx.
Public Constructors
Aim2DCommand()
| inline explicit |
Constructs an aim command with direction and frequency.
- Parameters
-
direction Normalized 2D direction vector.
freqFactor Magnitude of the stick input (0.0 to 1.0).
Definition at line 50 of file Aim2DCommand.ixx.
Public Member Functions
execute()
| inline noexcept virtual |
Executes the aim command on a GameObject.
- Parameters
-
gameObject The target entity with an Aim2DComponent.
Definition at line 64 of file Aim2DCommand.ixx.
Private Member Attributes
direction_
|
The normalized direction vector for aiming.
Definition at line 40 of file Aim2DCommand.ixx.
freqFactor_
|
The analog stick magnitude determining fire frequency.
Definition at line 35 of file Aim2DCommand.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.