Skip to main content

SpinComponent Class

Component that defines spin properties for an entity. More...

Declaration

class helios::engine::modules::effects::gfx::components::SpinComponent { ... }

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

boolisEnabled () const noexcept

Checks whether this component is enabled. More...

voidenable () noexcept

Enables this component. More...

voiddisable () noexcept

Disables this component. More...

helios::math::vec3faxis ()

Returns the rotation axis. More...

floatspeed () const

Returns the rotation speed. More...

floatrotation () const

Returns the current accumulated rotation. More...

voidsetRotation (float currentRotation)

Sets the current accumulated rotation. More...

Private Member Attributes Index

floatrotationSpeed_ = 720.0f

Rotation speed in degrees per second. More...

helios::math::vec3frotationAxis_ = helios::math::Z_AXISf

The axis around which the entity spins. More...

floatcurrentRotation_ = 0.0f

Current accumulated rotation angle in degrees. More...

boolisEnabled_ = 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()

helios::engine::modules::effects::gfx::components::SpinComponent::SpinComponent (const float rotationSpeed, const helios::math::vec3f rotationAxis)
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.

80 explicit SpinComponent(
81 const float rotationSpeed, const helios::math::vec3f rotationAxis
82 ) : rotationSpeed_(rotationSpeed),
83 rotationAxis_(rotationAxis) {}

Referenced by operator=, operator=, SpinComponent and SpinComponent.

SpinComponent()

helios::engine::modules::effects::gfx::components::SpinComponent::SpinComponent (const SpinComponent & other)
inline

Copy constructor.

Parameters
other

The component to copy from.

Definition at line 90 of file SpinComponent.ixx.

91 : rotationSpeed_(other.rotationSpeed_),
92 rotationAxis_(other.rotationAxis_) {}

Reference SpinComponent.

SpinComponent()

helios::engine::modules::effects::gfx::components::SpinComponent::SpinComponent (SpinComponent &&)
noexcept default

Definition at line 95 of file SpinComponent.ixx.

Reference SpinComponent.

Public Operators

operator=()

SpinComponent & helios::engine::modules::effects::gfx::components::SpinComponent::operator= (const SpinComponent &)
default

Definition at line 94 of file SpinComponent.ixx.

Reference SpinComponent.

operator=()

SpinComponent & helios::engine::modules::effects::gfx::components::SpinComponent::operator= (SpinComponent &&)
noexcept default

Definition at line 96 of file SpinComponent.ixx.

Reference SpinComponent.

Public Member Functions

axis()

helios::math::vec3f helios::engine::modules::effects::gfx::components::SpinComponent::axis ()
inline nodiscard

Returns the rotation axis.

Returns

The normalized rotation axis vector.

Definition at line 103 of file SpinComponent.ixx.

103 [[nodiscard]] helios::math::vec3f axis() {
104 return rotationAxis_;
105 }

Reference axis.

Referenced by axis.

disable()

void helios::engine::modules::effects::gfx::components::SpinComponent::disable ()
inline noexcept

Disables this component.

Definition at line 70 of file SpinComponent.ixx.

70 void disable() noexcept {
71 isEnabled_ = false;
72 }

enable()

void helios::engine::modules::effects::gfx::components::SpinComponent::enable ()
inline noexcept

Enables this component.

Definition at line 63 of file SpinComponent.ixx.

63 void enable() noexcept {
64 isEnabled_ = true;
65 }

isEnabled()

bool helios::engine::modules::effects::gfx::components::SpinComponent::isEnabled ()
inline nodiscard noexcept

Checks whether this component is enabled.

Returns

True if enabled, false otherwise.

Definition at line 56 of file SpinComponent.ixx.

56 [[nodiscard]] bool isEnabled() const noexcept {
57 return isEnabled_;
58 }

rotation()

float helios::engine::modules::effects::gfx::components::SpinComponent::rotation ()
inline nodiscard

Returns the current accumulated rotation.

Returns

Current rotation angle in degrees.

Definition at line 121 of file SpinComponent.ixx.

121 [[nodiscard]] float rotation() const {
122 return currentRotation_;
123 }

setRotation()

void helios::engine::modules::effects::gfx::components::SpinComponent::setRotation (float currentRotation)
inline

Sets the current accumulated rotation.

Parameters
currentRotation

The new rotation angle in degrees.

Definition at line 130 of file SpinComponent.ixx.

130 void setRotation(float currentRotation) {
131 currentRotation_ = currentRotation;
132 }

speed()

float helios::engine::modules::effects::gfx::components::SpinComponent::speed ()
inline nodiscard

Returns the rotation speed.

Returns

Speed in degrees per second.

Definition at line 112 of file SpinComponent.ixx.

112 [[nodiscard]] float speed() const {
113 return rotationSpeed_;
114 }

Private Member Attributes

currentRotation_

float helios::engine::modules::effects::gfx::components::SpinComponent::currentRotation_ = 0.0f

Current accumulated rotation angle in degrees.

Definition at line 42 of file SpinComponent.ixx.

42 float currentRotation_ = 0.0f;

isEnabled_

bool helios::engine::modules::effects::gfx::components::SpinComponent::isEnabled_ = true

Whether this component is enabled.

Definition at line 47 of file SpinComponent.ixx.

47 bool isEnabled_ = true;

rotationAxis_

helios::math::vec3f helios::engine::modules::effects::gfx::components::SpinComponent::rotationAxis_ = helios::math::Z_AXISf

The axis around which the entity spins.

Definition at line 37 of file SpinComponent.ixx.

rotationSpeed_

float helios::engine::modules::effects::gfx::components::SpinComponent::rotationSpeed_ = 720.0f

Rotation speed in degrees per second.

Definition at line 32 of file SpinComponent.ixx.

32 float rotationSpeed_ = 720.0f;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.