Aim2DComponent Class
Component for handling 2D aiming direction and fire frequency. More...
Declaration
Public Constructors Index
| Aim2DComponent ()=default | |
| Aim2DComponent (const Aim2DComponent &)=default | |
| Aim2DComponent (Aim2DComponent &&) noexcept=default | |
Public Operators Index
| Aim2DComponent & | operator= (const Aim2DComponent &)=default |
| Aim2DComponent & | operator= (Aim2DComponent &&) noexcept=default |
Public Member Functions Index
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
| void | enable () noexcept |
|
Enables this component. More... | |
| void | disable () noexcept |
|
Disables this component. More... | |
| void | aim (helios::math::vec2f direction, float freq) |
|
Sets the aim direction and fire frequency. More... | |
| const helios::math::vec2f & | direction () const noexcept |
|
Returns the current aim direction. More... | |
| float | frequency () const noexcept |
|
Returns the current frequency factor. More... | |
Protected Member Attributes Index
| helios::math::vec2f | direction_ {0.0f, 0.0f} |
|
Current aim direction as normalized 2D vector. More... | |
| float | frequency_ = 0.0f |
|
Current frequency factor (0.0 to 1.0) for additional fire rate control. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component for handling 2D aiming direction and fire frequency.
Receives aim direction and frequency factor from Aim2DCommand. Derived classes can override to implement specific aiming behaviors such as cannon rotation or crosshair positioning.
This is a base implementation with empty methods. Derive from this class to implement game-specific aiming logic.
Definition at line 29 of file Aim2DComponent.ixx.
Public Constructors
Aim2DComponent()
| default |
Definition at line 73 of file Aim2DComponent.ixx.
Referenced by Aim2DComponent, Aim2DComponent, operator= and operator=.
Aim2DComponent()
| default |
Definition at line 74 of file Aim2DComponent.ixx.
Reference Aim2DComponent.
Aim2DComponent()
| noexcept default |
Definition at line 76 of file Aim2DComponent.ixx.
Reference Aim2DComponent.
Public Operators
operator=()
| default |
Definition at line 75 of file Aim2DComponent.ixx.
Reference Aim2DComponent.
operator=()
| noexcept default |
Definition at line 77 of file Aim2DComponent.ixx.
Reference Aim2DComponent.
Public Member Functions
aim()
| inline |
Sets the aim direction and fire frequency.
- Parameters
-
direction Normalized 2D direction vector.
freq Fire frequency factor (0.0 to 1.0).
Definition at line 85 of file Aim2DComponent.ixx.
References aim, direction, direction_, helios::math::EPSILON_LENGTH and frequency_.
Referenced by aim.
direction()
| inline nodiscard noexcept |
Returns the current aim direction.
- Returns
Const reference to the normalized 2D direction vector.
Definition at line 100 of file Aim2DComponent.ixx.
Reference direction_.
Referenced by aim.
disable()
| inline noexcept |
enable()
| inline noexcept |
frequency()
| inline nodiscard noexcept |
Returns the current frequency factor.
- Returns
Fire frequency factor in range [0.0, 1.0].
Definition at line 109 of file Aim2DComponent.ixx.
Reference frequency_.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 55 of file Aim2DComponent.ixx.
Reference isEnabled_.
Protected Member Attributes
direction_
| protected |
Current aim direction as normalized 2D vector.
Definition at line 36 of file Aim2DComponent.ixx.
frequency_
| protected |
Current frequency factor (0.0 to 1.0) for additional fire rate control.
Definition at line 41 of file Aim2DComponent.ixx.
isEnabled_
| protected |
Whether this component is enabled.
Definition at line 46 of file Aim2DComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.