SpinComponent Class
Component that defines spin properties for an entity. More...
Declaration
Public Constructors Index
| SpinComponent (const float rotationSpeed, const helios::math::vec3f rotationAxis) | |
|
Constructs a SpinComponent. More... | |
| SpinComponent (const SpinComponent &other) | |
|
Copy constructor. More... | |
| SpinComponent (SpinComponent &&) noexcept=default | |
Public Operators Index
| SpinComponent & | operator= (const SpinComponent &)=default |
| SpinComponent & | operator= (SpinComponent &&) 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... | |
| helios::math::vec3f | axis () |
|
Returns the rotation axis. More... | |
| float | speed () const |
|
Returns the rotation speed. More... | |
| float | rotation () const |
|
Returns the current accumulated rotation. More... | |
| void | setRotation (float currentRotation) |
|
Sets the current accumulated rotation. More... | |
Private Member Attributes Index
| float | rotationSpeed_ = 720.0f |
|
Rotation speed in degrees per second. More... | |
| helios::math::vec3f | rotationAxis_ = helios::math::Z_AXISf |
|
The axis around which the entity spins. More... | |
| float | currentRotation_ = 0.0f |
|
Current accumulated rotation angle in degrees. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that defines spin properties for an entity.
This component is used by the SpinSystem to apply continuous rotation around a specific axis. It stores the rotation speed, axis, and current rotation state.
Definition at line 27 of file SpinComponent.ixx.
Public Constructors
SpinComponent()
| inline explicit |
Constructs a SpinComponent.
- Parameters
-
rotationSpeed Speed of rotation in degrees per second.
rotationAxis The axis to rotate around.
Definition at line 80 of file SpinComponent.ixx.
Referenced by operator=, operator=, SpinComponent and SpinComponent.
SpinComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 90 of file SpinComponent.ixx.
Reference SpinComponent.
SpinComponent()
| noexcept default |
Definition at line 95 of file SpinComponent.ixx.
Reference SpinComponent.
Public Operators
operator=()
| default |
Definition at line 94 of file SpinComponent.ixx.
Reference SpinComponent.
operator=()
| noexcept default |
Definition at line 96 of file SpinComponent.ixx.
Reference SpinComponent.
Public Member Functions
axis()
| inline nodiscard |
disable()
| inline noexcept |
Disables this component.
Definition at line 70 of file SpinComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 63 of file SpinComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 56 of file SpinComponent.ixx.
rotation()
| inline nodiscard |
Returns the current accumulated rotation.
- Returns
Current rotation angle in degrees.
Definition at line 121 of file SpinComponent.ixx.
setRotation()
| inline |
Sets the current accumulated rotation.
- Parameters
-
currentRotation The new rotation angle in degrees.
Definition at line 130 of file SpinComponent.ixx.
speed()
| inline nodiscard |
Returns the rotation speed.
- Returns
Speed in degrees per second.
Definition at line 112 of file SpinComponent.ixx.
Private Member Attributes
currentRotation_
|
Current accumulated rotation angle in degrees.
Definition at line 42 of file SpinComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 47 of file SpinComponent.ixx.
rotationAxis_
|
The axis around which the entity spins.
Definition at line 37 of file SpinComponent.ixx.
rotationSpeed_
|
Rotation speed in degrees per second.
Definition at line 32 of file SpinComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.