|
R-Type
Distributed multiplayer game engine in C++
|
System managing orbital module movement around parent entities. More...
#include <OrbitalSystem.hpp>


Public Member Functions | |
| OrbitalSystem ()=default | |
| Default constructor. | |
| ~OrbitalSystem () override=default | |
| Default destructor. | |
| void | update (Registry ®istry, float deltaTime) override |
| Updates all orbital module positions. | |
| ComponentMask | getComponentMask () const override |
| Gets the component mask for this system. | |
Public Member Functions inherited from ecs::ISystem | |
| virtual | ~ISystem ()=default |
| Virtual destructor. | |
Private Member Functions | |
| void | updateOrbitalPosition (Registry ®istry, Address moduleEntity, OrbitalModule &orbital, Transform &transform, float deltaTime) |
| Updates a single orbital module's position. | |
System managing orbital module movement around parent entities.
Updates positions of entities with OrbitalModule components to orbit around their parent entities. Uses circular motion with constant radius. Requires OrbitalModule and Transform components.
Definition at line 23 of file OrbitalSystem.hpp.
|
default |
Default constructor.
|
overridedefault |
Default destructor.
|
overridevirtual |
Gets the component mask for this system.
Implements ecs::ISystem.
Definition at line 72 of file OrbitalSystem.cpp.
Referenced by update().
|
overridevirtual |
Updates all orbital module positions.
Updates all orbital modules for the current frame.
For each orbital module:
| registry | Reference to the ECS registry |
| deltaTime | Time elapsed since last frame (in seconds) |
Implements ecs::ISystem.
Definition at line 18 of file OrbitalSystem.cpp.
References ecs::Registry::getComponent(), getComponentMask(), ecs::Registry::getEntitiesWithMask(), and updateOrbitalPosition().

|
private |
Updates a single orbital module's position.
| registry | Reference to the ECS registry |
| moduleEntity | Entity ID of the orbital module |
| orbital | OrbitalModule component |
| transform | Transform component to update |
| deltaTime | Time elapsed since last frame |
Definition at line 32 of file OrbitalSystem.cpp.
References ecs::Registry::getComponent(), ecs::OrbitalModule::getCurrentAngle(), ecs::OrbitalModule::getOrbitRadius(), ecs::OrbitalModule::getOrbitSpeed(), ecs::OrbitalModule::getParentEntityId(), ecs::Transform::getPosition(), ecs::Registry::hasComponent(), LOG_DEBUG, ecs::Registry::setComponent(), ecs::OrbitalModule::setCurrentAngle(), and ecs::Transform::setPosition().
Referenced by update().
