ComposeTransformComponent Class
Component that holds transformation data (position, rotation, scale). More...
Declaration
Public Constructors Index
| ComposeTransformComponent ()=default | |
|
Default constructor. More... | |
| ComposeTransformComponent (const ComposeTransformComponent &other) | |
|
Copy constructor. More... | |
| ComposeTransformComponent (ComposeTransformComponent &&) noexcept=default | |
Public Operators Index
| ComposeTransformComponent & | operator= (const ComposeTransformComponent &)=default |
| ComposeTransformComponent & | operator= (ComposeTransformComponent &&) 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... | |
| bool | isDirty () const noexcept |
|
Checks if the transform is dirty. More... | |
| void | clearDirty () noexcept |
|
Clears the dirty flag. 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... | |
| helios::math::mat4f | localTransform () const noexcept |
|
Returns the local transformation matrix. More... | |
| ComposeTransformComponent & | setLocalScale (const helios::math::vec3f &scale) noexcept |
|
Sets the local scale. More... | |
| ComposeTransformComponent & | setLocalRotation (const helios::math::mat4f &rotation) noexcept |
|
Sets the local rotation matrix. More... | |
| ComposeTransformComponent & | setLocalTranslation (const helios::math::vec3f &translation) noexcept |
|
Sets the local translation (position). More... | |
| ComposeTransformComponent & | translateLocalBy (const helios::math::vec3f &translation) noexcept |
|
Translates the component locally by a delta vector. More... | |
| helios::math::vec3f | localTranslation () const noexcept |
|
Returns the local translation vector. More... | |
| helios::math::mat4f | localRotation () const noexcept |
|
Returns the local rotation matrix. More... | |
| helios::math::vec3f | localScaling () const noexcept |
|
Returns the local scaling vector. More... | |
| void | setWorldTransform (const helios::math::mat4f &m) noexcept |
|
Sets the world transform matrix directly. More... | |
| const helios::math::mat4f & | worldTransform () noexcept |
|
Returns the current world transform matrix. More... | |
| helios::math::vec3f | worldTranslation () noexcept |
|
Extracts the world translation from the world transform. More... | |
Private Member Attributes Index
| helios::core::spatial::Transform | transform_ {} |
|
The local transformation (translation, rotation, scale). More... | |
| bool | isDirty_ = true |
|
Flag indicating if the transform has changed since the last update. More... | |
| helios::math::mat4f | worldTransform_ = helios::math::mat4f::identity() |
|
The computed world transformation matrix. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that holds transformation data (position, rotation, scale).
The ComposeTransformComponent manages the spatial state of a GameObject. It stores the local transform (relative to parent) and the computed world transform. Changes to local properties mark the component as dirty, signaling systems to recompute the world transform.
Definition at line 23 of file ComposeTransformComponent.ixx.
Public Constructors
ComposeTransformComponent()
| default |
Default constructor.
Definition at line 73 of file ComposeTransformComponent.ixx.
Referenced by ComposeTransformComponent, ComposeTransformComponent, operator=, operator=, setLocalRotation, setLocalScale, setLocalTranslation and translateLocalBy.
ComposeTransformComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 80 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
ComposeTransformComponent()
| noexcept default |
Definition at line 86 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
Public Operators
operator=()
| default |
Definition at line 85 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
operator=()
| noexcept default |
Definition at line 87 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
Public Member Functions
clearDirty()
| inline noexcept |
Clears the dirty flag.
Definition at line 101 of file ComposeTransformComponent.ixx.
disable()
| inline noexcept |
Disables this component.
Definition at line 66 of file ComposeTransformComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 59 of file ComposeTransformComponent.ixx.
isDirty()
| inline nodiscard noexcept |
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 52 of file ComposeTransformComponent.ixx.
localRotation()
| inline nodiscard noexcept |
Returns the local rotation matrix.
- Returns
The rotation relative to the parent.
Definition at line 198 of file ComposeTransformComponent.ixx.
localScaling()
| inline nodiscard noexcept |
Returns the local scaling vector.
- Returns
The scale relative to the parent.
Definition at line 208 of file ComposeTransformComponent.ixx.
localTransform()
| inline nodiscard noexcept |
Returns the local transformation matrix.
- Returns
The 4x4 matrix representing local translation, rotation, and scale.
Definition at line 128 of file ComposeTransformComponent.ixx.
localTranslation()
| inline nodiscard noexcept |
Returns the local translation vector.
- Returns
The position relative to the parent.
Definition at line 188 of file ComposeTransformComponent.ixx.
onAcquire()
| inline noexcept |
Resets the dirty flag to true when acquired.
Makes sure the transform is considered after the component was acquired.
Definition at line 110 of file ComposeTransformComponent.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 119 of file ComposeTransformComponent.ixx.
setLocalRotation()
| inline noexcept |
Sets the local rotation matrix.
- Parameters
-
rotation The new rotation matrix.
- Returns
Reference to this component for chaining.
Definition at line 152 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
setLocalScale()
| inline noexcept |
Sets the local scale.
- Parameters
-
scale The new scale vector.
- Returns
Reference to this component for chaining.
Definition at line 139 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
setLocalTranslation()
| inline noexcept |
Sets the local translation (position).
- Parameters
-
translation The new position vector.
- Returns
Reference to this component for chaining.
Definition at line 165 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
setWorldTransform()
| inline noexcept |
Sets the world transform matrix directly.
- Parameters
-
m The new world transform matrix.
Definition at line 217 of file ComposeTransformComponent.ixx.
translateLocalBy()
| inline noexcept |
Translates the component locally by a delta vector.
- Parameters
-
translation The vector to add to the current position.
- Returns
Reference to this component for chaining.
Definition at line 177 of file ComposeTransformComponent.ixx.
Reference ComposeTransformComponent.
worldTransform()
| inline noexcept |
Returns the current world transform matrix.
- Returns
Const reference to the world transform.
Definition at line 227 of file ComposeTransformComponent.ixx.
worldTranslation()
| inline noexcept |
Extracts the world translation from the world transform.
- Returns
The global position vector.
Definition at line 236 of file ComposeTransformComponent.ixx.
Private Member Attributes
isDirty_
|
Flag indicating if the transform has changed since the last update.
Definition at line 33 of file ComposeTransformComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 43 of file ComposeTransformComponent.ixx.
transform_
|
The local transformation (translation, rotation, scale).
Definition at line 28 of file ComposeTransformComponent.ixx.
worldTransform_
|
The computed world transformation matrix.
Definition at line 38 of file ComposeTransformComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.