TranslationStateComponent Class
Component that holds the current translation (position) state. More...
Declaration
Public Constructors Index
| TranslationStateComponent ()=default | |
|
Default constructor. More... | |
| TranslationStateComponent (const TranslationStateComponent &other) | |
|
Copy constructor. More... | |
| TranslationStateComponent (TranslationStateComponent &&) noexcept=default | |
|
Move constructor. More... | |
| TranslationStateComponent (const helios::math::vec3f translation) | |
|
Creates a new TranslationStateComponent with the specified translation vector. More... | |
Public Operators Index
| TranslationStateComponent & | operator= (const TranslationStateComponent &)=default |
|
Copy assignment operator. More... | |
| TranslationStateComponent & | operator= (TranslationStateComponent &&) noexcept=default |
|
Move assignment operator. More... | |
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 | onAcquire () noexcept |
|
Resets the translation vector to 0-vector when acquired. More... | |
| void | onRelease () noexcept |
|
Resets the translation vector to 0-vector when released. More... | |
| void | setTranslation (helios::math::vec3f translation) |
|
Sets the absolute translation. More... | |
| void | translateBy (helios::math::vec3f translation) |
|
Translates the current position by a delta vector. More... | |
| helios::math::vec3f | translation () const noexcept |
|
Returns the current translation vector. More... | |
Private Member Attributes Index
| helios::math::vec3f | translation_ {} |
|
The current translation vector. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that holds the current translation (position) state.
This component stores the accumulated translation vector. It acts as a data container for the ComposeTransformSystem to build the final translation matrix. It separates the raw position data from the computed ComposeTransformComponent.
Definition at line 25 of file TranslationStateComponent.ixx.
Public Constructors
TranslationStateComponent()
| default |
Default constructor.
Definition at line 65 of file TranslationStateComponent.ixx.
Referenced by operator=, operator=, TranslationStateComponent, TranslationStateComponent and TranslationStateComponent.
TranslationStateComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 72 of file TranslationStateComponent.ixx.
Reference TranslationStateComponent.
TranslationStateComponent()
| noexcept default |
Move constructor.
Definition at line 84 of file TranslationStateComponent.ixx.
Reference TranslationStateComponent.
TranslationStateComponent()
| inline explicit |
Creates a new TranslationStateComponent with the specified translation vector.
- Parameters
-
translation The translation vector this component should be initialized with.
Definition at line 96 of file TranslationStateComponent.ixx.
References translation and TranslationStateComponent.
Public Operators
operator=()
| default |
Copy assignment operator.
Definition at line 79 of file TranslationStateComponent.ixx.
Reference TranslationStateComponent.
operator=()
| noexcept default |
Move assignment operator.
Definition at line 89 of file TranslationStateComponent.ixx.
Reference TranslationStateComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 58 of file TranslationStateComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 51 of file TranslationStateComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 44 of file TranslationStateComponent.ixx.
onAcquire()
| inline noexcept |
Resets the translation vector to 0-vector when acquired.
Definition at line 102 of file TranslationStateComponent.ixx.
onRelease()
| inline noexcept |
Resets the translation vector to 0-vector when released.
Definition at line 110 of file TranslationStateComponent.ixx.
setTranslation()
| inline |
Sets the absolute translation.
- Parameters
-
translation The new position vector.
Definition at line 119 of file TranslationStateComponent.ixx.
Reference translation.
translateBy()
| inline |
Translates the current position by a delta vector.
- Parameters
-
translation The vector to add to the current position.
Definition at line 128 of file TranslationStateComponent.ixx.
Reference translation.
translation()
| inline nodiscard noexcept |
Returns the current translation vector.
- Returns
The current position.
Definition at line 137 of file TranslationStateComponent.ixx.
Referenced by setTranslation, translateBy, TranslationStateComponent and helios::engine::modules::ai::systems::ChaseSystem::update.
Private Member Attributes
isEnabled_
|
Whether this component is enabled.
Definition at line 35 of file TranslationStateComponent.ixx.
translation_
|
The current translation vector.
Definition at line 30 of file TranslationStateComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.