Skip to main content

Vec3Component Class Template

Generic 3D value component with dirty-state tracking. More...

Declaration

template <typename TDomainTag, typename TNumericType, typename ... Args> class helios::engine::core::components::Vec3Component<TDomainTag, TNumericType, Args> { ... }

Public Constructors Index

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component ()=default
template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component (const vec3< TNumericType > value)

Constructs the component with an initial value. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component (const TNumericType x, const TNumericType y, const TNumericType z)

Constructs the component from scalar vector coordinates. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component (const Vec3Component &other)

Copy constructor. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component (Vec3Component &&) noexcept=default

Default move constructor. More...

Public Operators Index

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component &operator= (const Vec3Component &)=default

Default copy assignment. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component &operator= (Vec3Component &&) noexcept=default

Default move assignment. More...

Public Member Functions Index

template <typename TDomainTag, typename TNumericType, typename ... Args>
voidonAcquire () noexcept

Lifecycle hook called when the component is acquired. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
voidonRelease () noexcept

Lifecycle hook called when the component is released. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
voidclearDirty () noexcept

Clears the dirty flag after dependent systems consumed updates. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
boolisDirty () const noexcept

Returns whether the component requires a refresh pass. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
auto value () const noexcept -> vec3< TNumericType >

Returns the current value. More...

template <typename TDomainTag, typename TNumericType, typename ... Args>
auto value () noexcept -> vec3< TNumericType >
template <typename TDomainTag, typename TNumericType, typename ... Args>
voidsetValue (const vec3< TNumericType > value) noexcept

Updates the value and marks the component dirty on change. More...

Private Member Attributes Index

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::math::vec3< TNumericType >value_ {}
template <typename TDomainTag, typename TNumericType, typename ... Args>
boolisDirty_ = true

Description

Generic 3D value component with dirty-state tracking.

Template Parameters
TDomainTag

Semantic domain tag.

THandle

Owning entity handle type.

TNumericType

Scalar type for vector values.

Definition at line 24 of file Vec3Component.ixx.

Public Constructors

Vec3Component()

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::Vec3Component ()
default

Definition at line 32 of file Vec3Component.ixx.

Vec3Component()

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::Vec3Component (const vec3< TNumericType > value)
inline explicit

Constructs the component with an initial value.

Parameters
value

Initial value vector.

Definition at line 39 of file Vec3Component.ixx.

39 explicit Vec3Component(const vec3<TNumericType> value) : value_(value){}

Vec3Component()

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::Vec3Component (const TNumericType x, const TNumericType y, const TNumericType z)
inline explicit

Constructs the component from scalar vector coordinates.

Parameters
x

X component.

y

Y component.

z

Z component.

Definition at line 48 of file Vec3Component.ixx.

48 explicit Vec3Component(
49 const TNumericType x, const TNumericType y, const TNumericType z)
50 : value_(x, y, z){}

Vec3Component()

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::Vec3Component (const Vec3Component & other)
inline

Copy constructor.

Copies the value and forces the copied component into a dirty state to ensure dependent systems refresh cached data.

Parameters
other

The component to copy from.

Definition at line 60 of file Vec3Component.ixx.

61 value_(other.value_),
62 isDirty_(true) {}

Vec3Component()

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::Vec3Component (Vec3Component &&)
noexcept default

Default move constructor.

Definition at line 67 of file Vec3Component.ixx.

Public Operators

operator=()

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component & helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::operator= (const Vec3Component &)
default

Default copy assignment.

Definition at line 65 of file Vec3Component.ixx.

operator=()

template <typename TDomainTag, typename TNumericType, typename ... Args>
Vec3Component & helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::operator= (Vec3Component &&)
noexcept default

Default move assignment.

Definition at line 69 of file Vec3Component.ixx.

Public Member Functions

clearDirty()

template <typename TDomainTag, typename TNumericType, typename ... Args>
void helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::clearDirty ()
inline noexcept

Clears the dirty flag after dependent systems consumed updates.

Definition at line 92 of file Vec3Component.ixx.

93 isDirty_ = false;
94 }

isDirty()

template <typename TDomainTag, typename TNumericType, typename ... Args>
bool helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::isDirty ()
inline noexcept

Returns whether the component requires a refresh pass.

Returns

true if value changed or lifecycle hooks marked dirty.

Definition at line 101 of file Vec3Component.ixx.

102 return isDirty_;
103 }

onAcquire()

template <typename TDomainTag, typename TNumericType, typename ... Args>
void helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::onAcquire ()
inline noexcept

Lifecycle hook called when the component is acquired.

Marks the component dirty to trigger downstream recomputation.

Definition at line 76 of file Vec3Component.ixx.

77 isDirty_ = true;
78 }

onRelease()

template <typename TDomainTag, typename TNumericType, typename ... Args>
void helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::onRelease ()
inline noexcept

Lifecycle hook called when the component is released.

Marks the component dirty to trigger downstream recomputation.

Definition at line 85 of file Vec3Component.ixx.

86 isDirty_ = true;
87 }

setValue()

template <typename TDomainTag, typename TNumericType, typename ... Args>
void helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::setValue (const vec3< TNumericType > value)
inline noexcept

Updates the value and marks the component dirty on change.

Parameters
value

New value vector.

Definition at line 123 of file Vec3Component.ixx.

123 void setValue(const vec3<TNumericType> value) noexcept {
124 value_ = value;
125 isDirty_ = true;
126 };

Reference helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::value.

value()

template <typename TDomainTag, typename TNumericType, typename ... Args>
vec3< TNumericType > helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::value ()
inline noexcept

Returns the current value.

Returns

Current 3D vector value.

Definition at line 110 of file Vec3Component.ixx.

111 return value_;
112 }

Referenced by helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::setValue.

value()

template <typename TDomainTag, typename TNumericType, typename ... Args>
vec3< TNumericType > helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::value ()
inline noexcept

Definition at line 114 of file Vec3Component.ixx.

115 return value_;
116 }

Private Member Attributes

isDirty_

template <typename TDomainTag, typename TNumericType, typename ... Args>
bool helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::isDirty_ = true

Definition at line 28 of file Vec3Component.ixx.

28 bool isDirty_ = true;

value_

template <typename TDomainTag, typename TNumericType, typename ... Args>
helios::math::vec3<TNumericType> helios::engine::core::components::Vec3Component< TDomainTag, TNumericType, Args >::value_ {}

Definition at line 26 of file Vec3Component.ixx.

26 helios::math::vec3<TNumericType> value_{};

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.