DimensionComponent Class Template
Component that defines the physical dimensions (scale) of an entity. More...
Declaration
Public Constructors Index
template <typename THandle> | |
| DimensionComponent (const float width, const float height, const float depth, const helios::engine::core::units::Unit unit=helios::engine::core::units::Unit::Meter) | |
|
Constructs a DimensionComponent with specified dimensions and unit. More... | |
template <typename THandle> | |
| DimensionComponent (const helios::math::vec3f scale, const helios::engine::core::units::Unit unit=helios::engine::core::units::Unit::Meter) | |
template <typename THandle> | |
| DimensionComponent (const DimensionComponent &other) | |
|
Copy constructor. More... | |
template <typename THandle> | |
| DimensionComponent (DimensionComponent &&) noexcept=default | |
Public Operators Index
template <typename THandle> | |
| DimensionComponent & | operator= (const DimensionComponent &)=default |
template <typename THandle> | |
| DimensionComponent & | operator= (DimensionComponent &&) noexcept=default |
Public Member Functions Index
template <typename THandle> | |
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
template <typename THandle> | |
| void | enable () noexcept |
|
Enables this component. More... | |
template <typename THandle> | |
| void | disable () noexcept |
|
Disables this component. More... | |
template <typename THandle> | |
| void | onAcquire () noexcept |
|
Resets the dirty flag to true when acquired. More... | |
template <typename THandle> | |
| void | onRelease () noexcept |
|
Resets the dirty flag to true when released. More... | |
template <typename THandle> | |
| void | clearDirty () noexcept |
|
Clears the dirty flag. More... | |
template <typename THandle> | |
| bool | isDirty () const noexcept |
|
Checks if the scale has changed. More... | |
template <typename THandle> | |
| helios::engine::core::units::Unit | unit () const noexcept |
|
Retrieves the unit of measurement. More... | |
template <typename THandle> | |
| helios::math::vec3f | scaling () const noexcept |
|
Retrieves the scaling vector (width, height, depth). More... | |
template <typename THandle> | |
| void | setDimensions (const float width, const float height, const float depth, const helios::engine::core::units::Unit unit=helios::engine::core::units::Unit::Meter) noexcept |
|
Sets the dimensions and unit of the entity. More... | |
Private Member Attributes Index
template <typename THandle> | |
| float | width_ |
|
Width of the entity. More... | |
template <typename THandle> | |
| float | height_ |
|
Height of the entity. More... | |
template <typename THandle> | |
| float | depth_ |
|
Depth of the entity. More... | |
template <typename THandle> | |
| helios::engine::core::units::Unit | unit_ |
|
Unit of measurement for the dimensions. More... | |
template <typename THandle> | |
| bool | isDirty_ = true |
|
Flag indicating if the scale has changed. More... | |
template <typename THandle> | |
| 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 29 of file DimensionComponent.ixx.
Public Constructors
DimensionComponent()
| inline explicit |
Constructs a DimensionComponent 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 93 of file DimensionComponent.ixx.
DimensionComponent()
| inline explicit |
Definition at line 100 of file DimensionComponent.ixx.
DimensionComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 110 of file DimensionComponent.ixx.
DimensionComponent()
| noexcept default |
Definition at line 118 of file DimensionComponent.ixx.
Public Operators
operator=()
| default |
Definition at line 117 of file DimensionComponent.ixx.
operator=()
| noexcept default |
Definition at line 119 of file DimensionComponent.ixx.
Public Member Functions
clearDirty()
| inline noexcept |
Clears the dirty flag.
Definition at line 145 of file DimensionComponent.ixx.
disable()
| inline noexcept |
Disables this component.
Definition at line 81 of file DimensionComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 74 of file DimensionComponent.ixx.
isDirty()
| inline noexcept |
isEnabled()
| inline noexcept |
onAcquire()
| inline noexcept |
Resets the dirty flag to true when acquired.
Makes sure scaling is considered once the component was acquired.
Definition at line 129 of file DimensionComponent.ixx.
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 138 of file DimensionComponent.ixx.
scaling()
| inline noexcept |
setDimensions()
| 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 185 of file DimensionComponent.ixx.
References helios::engine::spatial::registerComponents and helios::engine::spatial::components::DimensionComponent< THandle >::unit.
unit()
| inline noexcept |
Retrieves the unit of measurement.
- Returns
The unit enum value.
Definition at line 164 of file DimensionComponent.ixx.
Referenced by helios::engine::spatial::components::DimensionComponent< THandle >::setDimensions.
Private Member Attributes
depth_
|
height_
|
isDirty_
|
Flag indicating if the scale has changed.
Definition at line 53 of file DimensionComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 58 of file DimensionComponent.ixx.
unit_
|
Unit of measurement for the dimensions.
Definition at line 48 of file DimensionComponent.ixx.
width_
|
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.