Skip to main content

TranslationStateComponent Class

Component that holds the current translation (position) state. More...

Declaration

class helios::engine::modules::spatial::transform::components::TranslationStateComponent { ... }

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

boolisEnabled () const noexcept

Checks whether this component is enabled. More...

voidenable () noexcept

Enables this component. More...

voiddisable () noexcept

Disables this component. More...

voidonAcquire () noexcept

Resets the translation vector to 0-vector when acquired. More...

voidonRelease () noexcept

Resets the translation vector to 0-vector when released. More...

voidsetTranslation (helios::math::vec3f translation)

Sets the absolute translation. More...

voidtranslateBy (helios::math::vec3f translation)

Translates the current position by a delta vector. More...

helios::math::vec3ftranslation () const noexcept

Returns the current translation vector. More...

Private Member Attributes Index

helios::math::vec3ftranslation_ {}

The current translation vector. More...

boolisEnabled_ = 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()

helios::engine::modules::spatial::transform::components::TranslationStateComponent::TranslationStateComponent ()
default

TranslationStateComponent()

helios::engine::modules::spatial::transform::components::TranslationStateComponent::TranslationStateComponent (const TranslationStateComponent & other)
inline

Copy constructor.

Parameters
other

The component to copy from.

Definition at line 72 of file TranslationStateComponent.ixx.

73 translation_(other.translation_){
74 }

Reference TranslationStateComponent.

TranslationStateComponent()

helios::engine::modules::spatial::transform::components::TranslationStateComponent::TranslationStateComponent (TranslationStateComponent &&)
noexcept default

Move constructor.

Definition at line 84 of file TranslationStateComponent.ixx.

Reference TranslationStateComponent.

TranslationStateComponent()

helios::engine::modules::spatial::transform::components::TranslationStateComponent::TranslationStateComponent (const helios::math::vec3f translation)
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.

97 translation_(translation) {}

References translation and TranslationStateComponent.

Public Operators

operator=()

TranslationStateComponent & helios::engine::modules::spatial::transform::components::TranslationStateComponent::operator= (const TranslationStateComponent &)
default

Copy assignment operator.

Definition at line 79 of file TranslationStateComponent.ixx.

Reference TranslationStateComponent.

operator=()

TranslationStateComponent & helios::engine::modules::spatial::transform::components::TranslationStateComponent::operator= (TranslationStateComponent &&)
noexcept default

Move assignment operator.

Definition at line 89 of file TranslationStateComponent.ixx.

Reference TranslationStateComponent.

Public Member Functions

disable()

void helios::engine::modules::spatial::transform::components::TranslationStateComponent::disable ()
inline noexcept

Disables this component.

Definition at line 58 of file TranslationStateComponent.ixx.

58 void disable() noexcept {
59 isEnabled_ = false;
60 }

enable()

void helios::engine::modules::spatial::transform::components::TranslationStateComponent::enable ()
inline noexcept

Enables this component.

Definition at line 51 of file TranslationStateComponent.ixx.

51 void enable() noexcept {
52 isEnabled_ = true;
53 }

isEnabled()

bool helios::engine::modules::spatial::transform::components::TranslationStateComponent::isEnabled ()
inline nodiscard noexcept

Checks whether this component is enabled.

Returns

True if enabled, false otherwise.

Definition at line 44 of file TranslationStateComponent.ixx.

44 [[nodiscard]] bool isEnabled() const noexcept {
45 return isEnabled_;
46 }

onAcquire()

void helios::engine::modules::spatial::transform::components::TranslationStateComponent::onAcquire ()
inline noexcept

Resets the translation vector to 0-vector when acquired.

Definition at line 102 of file TranslationStateComponent.ixx.

102 void onAcquire() noexcept{
103 translation_ = helios::math::vec3f{};
104 }

onRelease()

void helios::engine::modules::spatial::transform::components::TranslationStateComponent::onRelease ()
inline noexcept

Resets the translation vector to 0-vector when released.

Definition at line 110 of file TranslationStateComponent.ixx.

110 void onRelease() noexcept {
111 translation_ = helios::math::vec3f{};
112 }

setTranslation()

void helios::engine::modules::spatial::transform::components::TranslationStateComponent::setTranslation (helios::math::vec3f translation)
inline

Sets the absolute translation.

Parameters
translation

The new position vector.

Definition at line 119 of file TranslationStateComponent.ixx.

120 translation_ = translation;
121 }

Reference translation.

translateBy()

void helios::engine::modules::spatial::transform::components::TranslationStateComponent::translateBy (helios::math::vec3f translation)
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.

129 translation_ = translation_ + translation;
130 }

Reference translation.

translation()

helios::math::vec3f helios::engine::modules::spatial::transform::components::TranslationStateComponent::translation ()
inline nodiscard noexcept

Returns the current translation vector.

Returns

The current position.

Definition at line 137 of file TranslationStateComponent.ixx.

137 [[nodiscard]] helios::math::vec3f translation() const noexcept {
138 return translation_;
139 }

Referenced by setTranslation, translateBy, TranslationStateComponent and helios::engine::modules::ai::systems::ChaseSystem::update.

Private Member Attributes

isEnabled_

bool helios::engine::modules::spatial::transform::components::TranslationStateComponent::isEnabled_ = true

Whether this component is enabled.

Definition at line 35 of file TranslationStateComponent.ixx.

35 bool isEnabled_ = true;

translation_

helios::math::vec3f helios::engine::modules::spatial::transform::components::TranslationStateComponent::translation_ {}

The current translation vector.

Definition at line 30 of file TranslationStateComponent.ixx.

30 helios::math::vec3f translation_{};

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.