ScaleStateComponent Class
Component that defines the physical dimensions (scale) of an entity. More...
Declaration
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
| 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 dirty flag to true when acquired. More... | |
| void | onRelease () noexcept |
|
Resets the dirty flag to true when released. More... | |
| void | clearDirty () noexcept |
|
Clears the dirty flag. More... | |
| bool | isDirty () const noexcept |
|
Checks if the scale has changed. More... | |
| helios::core::units::Unit | unit () const noexcept |
|
Retrieves the unit of measurement. More... | |
| helios::math::vec3f | scaling () const noexcept |
|
Retrieves the scaling vector (width, height, depth). More... | |
| void | setScale (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
| float | width_ |
|
Width of the entity. More... | |
| float | height_ |
|
Height of the entity. More... | |
| float | depth_ |
|
Depth of the entity. More... | |
| helios::core::units::Unit | unit_ |
|
Unit of measurement for the dimensions. More... | |
| bool | isDirty_ = true |
|
Flag indicating if the scale has changed. More... | |
| bool | isEnabled_ = 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()
| 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.
Reference unit.
Referenced by operator=, operator=, ScaleStateComponent and ScaleStateComponent.
ScaleStateComponent()
| inline explicit |
Definition at line 93 of file ScaleStateComponent.ixx.
References helios::core::units::Meter and unit.
ScaleStateComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 101 of file ScaleStateComponent.ixx.
Reference ScaleStateComponent.
ScaleStateComponent()
| noexcept default |
Definition at line 109 of file ScaleStateComponent.ixx.
Reference ScaleStateComponent.
Public Operators
operator=()
| default |
Definition at line 108 of file ScaleStateComponent.ixx.
Reference ScaleStateComponent.
operator=()
| noexcept default |
Definition at line 110 of file ScaleStateComponent.ixx.
Reference ScaleStateComponent.
Public Member Functions
clearDirty()
| inline noexcept |
Clears the dirty flag.
Definition at line 136 of file ScaleStateComponent.ixx.
disable()
| inline noexcept |
Disables this component.
Definition at line 78 of file ScaleStateComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 71 of file ScaleStateComponent.ixx.
isDirty()
| inline nodiscard noexcept |
Checks if the scale has changed.
- Returns
True if dirty, false otherwise.
Definition at line 145 of file ScaleStateComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 64 of file ScaleStateComponent.ixx.
onAcquire()
| inline noexcept |
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.
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.
setScale()
| 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.
References helios::core::units::Meter and unit.
unit()
| inline nodiscard noexcept |
Retrieves the unit of measurement.
- Returns
The unit enum value.
Definition at line 155 of file ScaleStateComponent.ixx.
Referenced by ScaleStateComponent, ScaleStateComponent and setScale.
Private Member Attributes
depth_
|
height_
|
isDirty_
|
Flag indicating if the scale has changed.
Definition at line 50 of file ScaleStateComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 55 of file ScaleStateComponent.ixx.
unit_
|
Unit of measurement for the dimensions.
Definition at line 45 of file ScaleStateComponent.ixx.
width_
|
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.