Skip to main content

ScaleStateComponent Class

Component that defines the physical dimensions (scale) of an entity. More...

Declaration

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

Public Constructors Index

ScaleStateComponent (const float width, const float height, const float depth, const helios::core::units::Unit unit)

Constructs a ScaleStateComponent with specified dimensions and unit. More...

ScaleStateComponent (const helios::math::vec3f scale, const helios::core::units::Unit unit=helios::core::units::Unit::Meter)
ScaleStateComponent (const ScaleStateComponent &other)

Copy constructor. More...

ScaleStateComponent (ScaleStateComponent &&) noexcept=default

Public Operators Index

ScaleStateComponent &operator= (const ScaleStateComponent &)=default
ScaleStateComponent &operator= (ScaleStateComponent &&) noexcept=default

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 dirty flag to true when acquired. More...

voidonRelease () noexcept

Resets the dirty flag to true when released. More...

voidclearDirty () noexcept

Clears the dirty flag. More...

boolisDirty () const noexcept

Checks if the scale has changed. More...

helios::core::units::Unitunit () const noexcept

Retrieves the unit of measurement. More...

helios::math::vec3fscaling () const noexcept

Retrieves the scaling vector (width, height, depth). More...

voidsetScale (const float width, const float height, const float depth, const helios::core::units::Unit unit=helios::core::units::Unit::Meter) noexcept

Sets the dimensions and unit of the entity. More...

Private Member Attributes Index

floatwidth_

Width of the entity. More...

floatheight_

Height of the entity. More...

floatdepth_

Depth of the entity. More...

helios::core::units::Unitunit_

Unit of measurement for the dimensions. More...

boolisDirty_ = true

Flag indicating if the scale has changed. More...

boolisEnabled_ = true

Whether this component is enabled. More...

Description

Component that defines the physical dimensions (scale) of an entity.

This component stores the width, height, and depth of an entity, along with the unit of measurement. It tracks changes via a dirty flag, allowing other systems to react to scale updates.

Definition at line 26 of file ScaleStateComponent.ixx.

Public Constructors

ScaleStateComponent()

helios::engine::modules::spatial::transform::components::ScaleStateComponent::ScaleStateComponent (const float width, const float height, const float depth, const helios::core::units::Unit unit)
inline explicit

Constructs a ScaleStateComponent with specified dimensions and unit.

Parameters
width

Width of the entity.

height

Height of the entity.

depth

Depth of the entity.

unit

Unit of measurement (default: Meter).

Definition at line 90 of file ScaleStateComponent.ixx.

90 explicit ScaleStateComponent(const float width, const float height, const float depth, const helios::core::units::Unit unit) :
91 width_(width), height_(height), depth_(depth), unit_(unit) {}

Reference unit.

Referenced by operator=, operator=, ScaleStateComponent and ScaleStateComponent.

ScaleStateComponent()

helios::engine::modules::spatial::transform::components::ScaleStateComponent::ScaleStateComponent (const helios::math::vec3f scale, const helios::core::units::Unit unit=helios::core::units::Unit::Meter)
inline explicit

Definition at line 93 of file ScaleStateComponent.ixx.

94 width_(scale[0]), height_(scale[1]), depth_(scale[2]), unit_(unit) {}

References helios::core::units::Meter and unit.

ScaleStateComponent()

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

Copy constructor.

Parameters
other

The component to copy from.

Definition at line 101 of file ScaleStateComponent.ixx.

102 width_(other.width_),
103 height_(other.height_),
104 depth_(other.depth_),
105 unit_(other.unit_),
106 isDirty_(true) {}

Reference ScaleStateComponent.

ScaleStateComponent()

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

Definition at line 109 of file ScaleStateComponent.ixx.

Reference ScaleStateComponent.

Public Operators

operator=()

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

Definition at line 108 of file ScaleStateComponent.ixx.

Reference ScaleStateComponent.

operator=()

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

Definition at line 110 of file ScaleStateComponent.ixx.

Reference ScaleStateComponent.

Public Member Functions

clearDirty()

void helios::engine::modules::spatial::transform::components::ScaleStateComponent::clearDirty ()
inline noexcept

Clears the dirty flag.

Definition at line 136 of file ScaleStateComponent.ixx.

136 void clearDirty() noexcept {
137 isDirty_ = false;
138 }

disable()

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

Disables this component.

Definition at line 78 of file ScaleStateComponent.ixx.

78 void disable() noexcept {
79 isEnabled_ = false;
80 }

enable()

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

Enables this component.

Definition at line 71 of file ScaleStateComponent.ixx.

71 void enable() noexcept {
72 isEnabled_ = true;
73 }

isDirty()

bool helios::engine::modules::spatial::transform::components::ScaleStateComponent::isDirty ()
inline nodiscard noexcept

Checks if the scale has changed.

Returns

True if dirty, false otherwise.

Definition at line 145 of file ScaleStateComponent.ixx.

145 [[nodiscard]] bool isDirty() const noexcept {
146 return isDirty_;
147 }

isEnabled()

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

Checks whether this component is enabled.

Returns

True if enabled, false otherwise.

Definition at line 64 of file ScaleStateComponent.ixx.

64 [[nodiscard]] bool isEnabled() const noexcept {
65 return isEnabled_;
66 }

onAcquire()

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

Resets the dirty flag to true when acquired.

Makes sure scaling is considered once the component was acquired.

Definition at line 120 of file ScaleStateComponent.ixx.

120 void onAcquire() noexcept {
121 isDirty_ = true;
122 }

Reference onAcquire.

Referenced by onAcquire.

onRelease()

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

Resets the dirty flag to true when released.

Makes sure the entities dirty-state is reset to the default state.

Definition at line 129 of file ScaleStateComponent.ixx.

129 void onRelease() noexcept {
130 isDirty_ = true;
131 }

scaling()

helios::math::vec3f helios::engine::modules::spatial::transform::components::ScaleStateComponent::scaling ()
inline nodiscard noexcept

Retrieves the scaling vector (width, height, depth).

Returns

A vec3f containing the dimensions.

Definition at line 164 of file ScaleStateComponent.ixx.

164 [[nodiscard]] helios::math::vec3f scaling() const noexcept {
165 return {width_, height_, depth_};
166 }

setScale()

void helios::engine::modules::spatial::transform::components::ScaleStateComponent::setScale (const float width, const float height, const float depth, const helios::core::units::Unit unit=helios::core::units::Unit::Meter)
inline noexcept

Sets the dimensions and unit of the entity.

Parameters
width

New width.

height

New height.

depth

New depth.

unit

New unit of measurement (default: Meter).

Definition at line 176 of file ScaleStateComponent.ixx.

176 void setScale(const float width, const float height, const float depth,
178 ) noexcept {
179
180 width_ = width;
181 height_ = height;
182 depth_ = depth;
183 unit_ = unit;
184 isDirty_ = true;
185
186 };

References helios::core::units::Meter and unit.

unit()

helios::core::units::Unit helios::engine::modules::spatial::transform::components::ScaleStateComponent::unit ()
inline nodiscard noexcept

Retrieves the unit of measurement.

Returns

The unit enum value.

Definition at line 155 of file ScaleStateComponent.ixx.

155 [[nodiscard]] helios::core::units::Unit unit() const noexcept {
156 return unit_;
157 }

Referenced by ScaleStateComponent, ScaleStateComponent and setScale.

Private Member Attributes

depth_

float helios::engine::modules::spatial::transform::components::ScaleStateComponent::depth_

Depth of the entity.

Definition at line 40 of file ScaleStateComponent.ixx.

40 float depth_;

height_

float helios::engine::modules::spatial::transform::components::ScaleStateComponent::height_

Height of the entity.

Definition at line 35 of file ScaleStateComponent.ixx.

35 float height_;

isDirty_

bool helios::engine::modules::spatial::transform::components::ScaleStateComponent::isDirty_ = true

Flag indicating if the scale has changed.

Definition at line 50 of file ScaleStateComponent.ixx.

50 bool isDirty_ = true;

isEnabled_

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

Whether this component is enabled.

Definition at line 55 of file ScaleStateComponent.ixx.

55 bool isEnabled_ = true;

unit_

helios::core::units::Unit helios::engine::modules::spatial::transform::components::ScaleStateComponent::unit_

Unit of measurement for the dimensions.

Definition at line 45 of file ScaleStateComponent.ixx.

width_

float helios::engine::modules::spatial::transform::components::ScaleStateComponent::width_

Width of the entity.

Definition at line 30 of file ScaleStateComponent.ixx.

30 float width_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.