SteeringCommand Class
Command that updates the heading direction of a GameObject. More...
Declaration
Base class
| class | TargetedCommand |
|
Abstract base class for commands targeting a specific GameObject. More... | |
Public Constructors Index
| SteeringCommand (const helios::math::vec2f direction, float turnFactor) | |
|
Constructs a new SteeringCommand. More... | |
Public Member Functions Index
| void | execute (helios::engine::ecs::GameObject gameObject) const noexcept override |
|
Executes the heading update on the target GameObject. More... | |
Private Member Attributes Index
| const float | turnFactor_ |
|
The interpolation factor for the turn (0.0 to 1.0). More... | |
| const helios::math::vec2f | direction_ {} |
|
The target direction vector. More... | |
Description
Command that updates the heading direction of a GameObject.
This command encapsulates a request to change the heading (facing direction) of a GameObject. It targets the SteeringComponent and applies the specified direction and turn factor (interpolation speed).
Definition at line 25 of file SteeringCommand.ixx.
Public Constructors
SteeringCommand()
| inline explicit |
Constructs a new SteeringCommand.
- Parameters
-
direction The target direction vector (should be normalized).
turnFactor The speed/interpolation factor for the turn.
Definition at line 46 of file SteeringCommand.ixx.
Public Member Functions
execute()
| inline noexcept virtual |
Executes the heading update on the target GameObject.
Retrieves the SteeringComponent from the GameObject and calls setHeading() with the stored direction and turn factor. If the component is missing, the command does nothing.
- Parameters
-
gameObject The GameObject to apply the command to.
Definition at line 65 of file SteeringCommand.ixx.
Private Member Attributes
direction_
|
The target direction vector.
Definition at line 36 of file SteeringCommand.ixx.
turnFactor_
|
The interpolation factor for the turn (0.0 to 1.0).
Definition at line 31 of file SteeringCommand.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.