SteeringCommand Class
Command that updates the heading direction of a GameObject. More...
Declaration
Public Constructors Index
| SteeringCommand (const helios::engine::ecs::EntityHandle entityHandle, const helios::math::vec2f direction, float turnFactor) | |
|
Constructs a new SteeringCommand. More... | |
Public Member Functions Index
| void | execute (helios::engine::runtime::world::UpdateContext &updateContext) const noexcept |
|
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... | |
| const helios::engine::ecs::EntityHandle | entityHandle_ |
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 28 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 52 of file SteeringCommand.ixx.
Public Member Functions
execute()
| inline noexcept |
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 73 of file SteeringCommand.ixx.
Private Member Attributes
direction_
|
The target direction vector.
Definition at line 39 of file SteeringCommand.ixx.
entityHandle_
|
Definition at line 42 of file SteeringCommand.ixx.
turnFactor_
|
The interpolation factor for the turn (0.0 to 1.0).
Definition at line 34 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.