RotationStateComponent Class
Component that manages composite rotation from heading and spin rotations. More...
Declaration
Public Constructors Index
| RotationStateComponent ()=default | |
|
Default constructor. More... | |
| RotationStateComponent (const RotationStateComponent &other) | |
|
Copy constructor. More... | |
| RotationStateComponent (RotationStateComponent &&) noexcept=default | |
Public Operators Index
| RotationStateComponent & | operator= (const RotationStateComponent &)=default |
| RotationStateComponent & | operator= (RotationStateComponent &&) 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 | setHeadingRotationAngle (float angle) |
|
Sets the heading rotation angle. More... | |
| float | headingRotationAngle () const noexcept |
|
Returns the current heading rotation angle. More... | |
| void | setHeadingRotationAxis (helios::math::vec3f axis) |
|
Sets the heading rotation axis. More... | |
| helios::math::vec3f | headingRotationAxis () const noexcept |
|
Returns the heading rotation axis. More... | |
| void | setSpinRotationAngle (float angle) |
|
Sets the spin rotation angle. More... | |
| float | spinRotationAngle () const noexcept |
|
Returns the current spin rotation angle. More... | |
| void | setSpinRotationAxis (helios::math::vec3f axis) |
|
Sets the spin rotation axis. More... | |
| helios::math::vec3f | spinRotationAxis () const noexcept |
|
Returns the spin rotation axis. More... | |
| const helios::math::mat4f & | spinRotation () noexcept |
|
Returns the spin rotation matrix. More... | |
| const helios::math::mat4f & | headingRotation () noexcept |
|
Returns the heading rotation matrix. More... | |
| const helios::math::mat4f & | rotation () noexcept |
|
Returns the composed rotation matrix (heading * spin). More... | |
Private Member Functions Index
| void | update () |
|
Recalculates rotation matrices if dirty. More... | |
Private Member Attributes Index
| float | headingRotationAngle_ = 0.0f |
|
Current heading rotation angle in degrees. More... | |
| helios::math::vec3f | headingRotationAxis_ {} |
|
Axis around which heading rotation occurs. More... | |
| float | spinRotationAngle_ = 0.0f |
|
Current spin rotation angle in degrees. More... | |
| helios::math::vec3f | spinRotationAxis_ {} |
|
Axis around which spin rotation occurs. More... | |
| bool | needsUpdate_ = true |
|
Dirty flag indicating matrices need recalculation. More... | |
| helios::math::mat4f | spinRotationMatrix_ |
|
Cached spin rotation matrix. More... | |
| helios::math::mat4f | headingRotationMatrix_ |
|
Cached heading rotation matrix. More... | |
| helios::math::mat4f | composedRotationMatrix_ |
|
Cached composed rotation matrix (heading * spin). More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that manages composite rotation from heading and spin rotations.
This component combines two independent rotation sources:
- **Heading Rotation:** The direction the entity is facing (controlled by input).
- **Spin Rotation:** Additional rotation for visual effects (e.g., rolling, tumbling).
The component caches the computed rotation matrices and only recalculates them when the underlying angles or axes change (dirty flag pattern).
Definition at line 31 of file RotationStateComponent.ixx.
Public Constructors
RotationStateComponent()
| default |
Default constructor.
Definition at line 139 of file RotationStateComponent.ixx.
Referenced by operator=, operator=, RotationStateComponent and RotationStateComponent.
RotationStateComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Copies rotation axes but resets angles and matrices.
Definition at line 148 of file RotationStateComponent.ixx.
Reference RotationStateComponent.
RotationStateComponent()
| noexcept default |
Definition at line 154 of file RotationStateComponent.ixx.
Reference RotationStateComponent.
Public Operators
operator=()
| default |
Definition at line 153 of file RotationStateComponent.ixx.
Reference RotationStateComponent.
operator=()
| noexcept default |
Definition at line 155 of file RotationStateComponent.ixx.
Reference RotationStateComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 99 of file RotationStateComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 92 of file RotationStateComponent.ixx.
headingRotation()
| inline noexcept |
Returns the heading rotation matrix.
Triggers matrix update if dirty.
- Returns
Const reference to the heading rotation matrix.
Definition at line 252 of file RotationStateComponent.ixx.
headingRotationAngle()
| inline nodiscard noexcept |
Returns the current heading rotation angle.
- Returns
The heading rotation angle in degrees.
Definition at line 172 of file RotationStateComponent.ixx.
headingRotationAxis()
| inline nodiscard noexcept |
Returns the heading rotation axis.
- Returns
The current heading rotation axis.
Definition at line 191 of file RotationStateComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 85 of file RotationStateComponent.ixx.
rotation()
| inline noexcept |
Returns the composed rotation matrix (heading * spin).
Triggers matrix update if dirty.
- Returns
Const reference to the composed rotation matrix.
Definition at line 264 of file RotationStateComponent.ixx.
setHeadingRotationAngle()
| inline |
Sets the heading rotation angle.
- Parameters
-
angle The new heading rotation angle in degrees (wrapped to 0-360).
Definition at line 162 of file RotationStateComponent.ixx.
Reference setHeadingRotationAngle.
Referenced by helios::engine::builder::gameObject::builders::configs::TransformConfig::rotate and setHeadingRotationAngle.
setHeadingRotationAxis()
| inline |
Sets the heading rotation axis.
- Parameters
-
axis The new rotation axis (should be normalized).
Definition at line 181 of file RotationStateComponent.ixx.
setSpinRotationAngle()
| inline |
Sets the spin rotation angle.
- Parameters
-
angle The new spin rotation angle in degrees (wrapped to 0-360).
Definition at line 200 of file RotationStateComponent.ixx.
setSpinRotationAxis()
| inline |
Sets the spin rotation axis.
- Parameters
-
axis The new spin rotation axis (should be normalized).
Definition at line 219 of file RotationStateComponent.ixx.
spinRotation()
| inline noexcept |
Returns the spin rotation matrix.
Triggers matrix update if dirty.
- Returns
Const reference to the spin rotation matrix.
Definition at line 240 of file RotationStateComponent.ixx.
spinRotationAngle()
| inline nodiscard noexcept |
Returns the current spin rotation angle.
- Returns
The spin rotation angle in degrees.
Definition at line 210 of file RotationStateComponent.ixx.
spinRotationAxis()
| inline nodiscard noexcept |
Returns the spin rotation axis.
- Returns
The current spin rotation axis.
Definition at line 229 of file RotationStateComponent.ixx.
Private Member Functions
update()
| inline |
Recalculates rotation matrices if dirty.
Updates spinRotationMatrix_, headingRotationMatrix_, and composedRotationMatrix_ based on current angles and axes.
Definition at line 111 of file RotationStateComponent.ixx.
Private Member Attributes
composedRotationMatrix_
|
Cached composed rotation matrix (heading * spin).
Definition at line 71 of file RotationStateComponent.ixx.
headingRotationAngle_
|
Current heading rotation angle in degrees.
Definition at line 36 of file RotationStateComponent.ixx.
headingRotationAxis_
|
Axis around which heading rotation occurs.
Definition at line 41 of file RotationStateComponent.ixx.
headingRotationMatrix_
|
Cached heading rotation matrix.
Definition at line 66 of file RotationStateComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 76 of file RotationStateComponent.ixx.
needsUpdate_
|
Dirty flag indicating matrices need recalculation.
Definition at line 56 of file RotationStateComponent.ixx.
spinRotationAngle_
|
Current spin rotation angle in degrees.
Definition at line 46 of file RotationStateComponent.ixx.
spinRotationAxis_
|
Axis around which spin rotation occurs.
Definition at line 51 of file RotationStateComponent.ixx.
spinRotationMatrix_
|
Cached spin rotation matrix.
Definition at line 61 of file RotationStateComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.