Skip to main content

SpinSystem Class

System that updates the spin rotation of entities. More...

Declaration

class helios::engine::modules::physics::motion::systems::SpinSystem { ... }

Public Member Typedefs Index

usingEngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions Index

voidupdate (helios::engine::runtime::world::UpdateContext &updateContext) noexcept

Updates spin rotation for all applicable entities. More...

Private Static Attributes Index

static const helios::math::mat4fidentity = helios::math::mat4f::identity()

Identity matrix constant. More...

Description

System that updates the spin rotation of entities.

This system iterates over entities with a SpinComponent and updates their accumulated rotation angle based on the spin speed and delta time. The updated rotation state is then written to the RotationStateComponent.

Definition at line 36 of file SpinSystem.ixx.

Public Member Typedefs

EngineRoleTag

using helios::engine::modules::physics::motion::systems::SpinSystem::EngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions

update()

void helios::engine::modules::physics::motion::systems::SpinSystem::update (helios::engine::runtime::world::UpdateContext & updateContext)
inline noexcept

Updates spin rotation for all applicable entities.

Parameters
updateContext

Context containing frame timing and game state.

Definition at line 52 of file SpinSystem.ixx.

53
54
55 for (auto [entity, sc, rsc, active] : updateContext.view<
59 >().whereEnabled()) {
60
61 float delta = updateContext.deltaTime();
62
63 sc->setRotation(std::fmod(sc->rotation() + sc->speed() * delta, 360.0f));
64
65 rsc->setSpinRotationAxis(sc->axis());
66 rsc->setSpinRotationAngle(sc->rotation());
67 }
68
69
70 }

Private Static Attributes

identity

const helios::math::mat4f helios::engine::modules::physics::motion::systems::SpinSystem::identity = helios::math::mat4f::identity()
static

Identity matrix constant.

Definition at line 41 of file SpinSystem.ixx.

41 inline static const helios::math::mat4f identity = helios::math::mat4f::identity();

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.