Move2DCommand Class
Command that applies 2D directional movement to a GameObject. More...
Declaration
Base class
| class | TargetedCommand |
|
Abstract base class for commands targeting a specific GameObject. More... | |
Public Constructors Index
| Move2DCommand (const helios::math::vec2f direction, const float speedFactor) | |
|
Constructs a movement command with direction and speed. More... | |
Public Member Functions Index
| void | execute (helios::engine::ecs::GameObject gameObject) const noexcept override |
|
Executes the movement command on a GameObject. More... | |
Private Member Attributes Index
| const float | speedFactor_ |
|
The analog stick magnitude determining movement intensity. More... | |
| const helios::math::vec2f | direction_ |
|
The normalized direction vector for movement. More... | |
Description
Command that applies 2D directional movement to a GameObject.
This command encapsulates a movement request consisting of a normalized direction vector and a speed factor derived from analog stick magnitude. When executed, it invokes Move2DComponent::move() to update rotation target and movement speed.
The target GameObject must have a Move2DComponent attached for this command to have any effect.
- See Also
helios::engine::runtime::messaging::command::Command
Definition at line 31 of file Move2DCommand.ixx.
Public Constructors
Move2DCommand()
| inline explicit |
Constructs a movement command with direction and speed.
- Parameters
-
direction Normalized 2D direction vector.
speedFactor Magnitude of the stick input (0.0 to 1.0).
Definition at line 51 of file Move2DCommand.ixx.
Public Member Functions
execute()
| inline noexcept virtual |
Executes the movement command on a GameObject.
- Parameters
-
gameObject The target entity with a Move2DComponent.
Definition at line 64 of file Move2DCommand.ixx.
Private Member Attributes
direction_
|
The normalized direction vector for movement.
Definition at line 41 of file Move2DCommand.ixx.
speedFactor_
|
The analog stick magnitude determining movement intensity.
Definition at line 36 of file Move2DCommand.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.