|
R-Type
Distributed multiplayer game engine in C++
|
Component for entities that orbit around a parent entity (like drones in Isaac). More...
#include <OrbitalModule.hpp>


Public Member Functions | |
| OrbitalModule (uint32_t parentEntityId, float orbitRadius, float orbitSpeed, float startAngle=0.0f, int damage=10) | |
| Constructor with all orbital parameters. | |
| ~OrbitalModule () override=default | |
| uint32_t | getParentEntityId () const |
| Get parent entity ID. | |
| float | getOrbitRadius () const |
| Get orbit radius. | |
| float | getOrbitSpeed () const |
| Get orbit speed. | |
| float | getCurrentAngle () const |
| Get current angle. | |
| int | getDamage () const |
| Get contact damage. | |
| bool | blocksProjectiles () const |
| Check if blocks projectiles. | |
| void | setParentEntityId (uint32_t parentEntityId) |
| Set parent entity ID. | |
| void | setOrbitRadius (float orbitRadius) |
| Set orbit radius. | |
| void | setOrbitSpeed (float orbitSpeed) |
| Set orbit speed. | |
| void | setCurrentAngle (float angle) |
| Set current angle. | |
| void | setDamage (int damage) |
| Set contact damage. | |
| void | setBlocksProjectiles (bool blocks) |
| Set projectile blocking status. | |
| ComponentType | getType () const override |
| Get the component type ID. | |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Private Attributes | |
| uint32_t | _parentEntityId |
| Entity to orbit around. | |
| float | _orbitRadius |
| Distance from parent (in pixels) | |
| float | _orbitSpeed |
| Angular velocity (rad/s) | |
| float | _currentAngle |
| Current orbital angle (radians) | |
| int | _damage |
| Damage dealt on contact. | |
| bool | _blocksProjectiles |
| Whether it blocks enemy projectiles. | |
Component for entities that orbit around a parent entity (like drones in Isaac).
Defines orbital movement around a parent entity (typically a player). The module rotates at a fixed radius and speed, blocking projectiles and damaging enemies on contact.
Definition at line 22 of file OrbitalModule.hpp.
|
inline |
Constructor with all orbital parameters.
| parentEntityId | ID of the entity to orbit around |
| orbitRadius | Distance from parent entity center |
| orbitSpeed | Angular velocity in radians per second |
| startAngle | Initial angle in radians (default: 0) |
| damage | Damage dealt on contact with enemies |
Definition at line 32 of file OrbitalModule.hpp.
|
overridedefault |
|
inline |
Check if blocks projectiles.
Definition at line 77 of file OrbitalModule.hpp.
References _blocksProjectiles.
|
inline |
Get current angle.
Definition at line 65 of file OrbitalModule.hpp.
References _currentAngle.
Referenced by ecs::OrbitalSystem::updateOrbitalPosition().
|
inline |
Get contact damage.
Definition at line 71 of file OrbitalModule.hpp.
References _damage.
|
inline |
Get orbit radius.
Definition at line 53 of file OrbitalModule.hpp.
References _orbitRadius.
Referenced by ecs::OrbitalSystem::updateOrbitalPosition().
|
inline |
Get orbit speed.
Definition at line 59 of file OrbitalModule.hpp.
References _orbitSpeed.
Referenced by ecs::OrbitalSystem::updateOrbitalPosition().
|
inline |
Get parent entity ID.
Definition at line 47 of file OrbitalModule.hpp.
References _parentEntityId.
Referenced by ecs::OrbitalSystem::updateOrbitalPosition().
|
inlineoverridevirtual |
Get the component type ID.
Implements ecs::IComponent.
Definition at line 119 of file OrbitalModule.hpp.
|
inline |
Set projectile blocking status.
| blocks | True to block projectiles |
Definition at line 113 of file OrbitalModule.hpp.
References _blocksProjectiles.
|
inline |
Set current angle.
| angle | New angle in radians |
Definition at line 101 of file OrbitalModule.hpp.
References _currentAngle.
Referenced by ecs::OrbitalSystem::updateOrbitalPosition().
|
inline |
Set contact damage.
| damage | New damage value |
Definition at line 107 of file OrbitalModule.hpp.
References _damage.
|
inline |
Set orbit radius.
| orbitRadius | New orbit radius |
Definition at line 89 of file OrbitalModule.hpp.
References _orbitRadius.
|
inline |
Set orbit speed.
| orbitSpeed | New angular velocity |
Definition at line 95 of file OrbitalModule.hpp.
References _orbitSpeed.
|
inline |
Set parent entity ID.
| parentEntityId | New parent entity ID |
Definition at line 83 of file OrbitalModule.hpp.
References _parentEntityId.
|
private |
Whether it blocks enemy projectiles.
Definition at line 127 of file OrbitalModule.hpp.
Referenced by blocksProjectiles(), and setBlocksProjectiles().
|
private |
Current orbital angle (radians)
Definition at line 125 of file OrbitalModule.hpp.
Referenced by getCurrentAngle(), and setCurrentAngle().
|
private |
Damage dealt on contact.
Definition at line 126 of file OrbitalModule.hpp.
Referenced by getDamage(), and setDamage().
|
private |
Distance from parent (in pixels)
Definition at line 123 of file OrbitalModule.hpp.
Referenced by getOrbitRadius(), and setOrbitRadius().
|
private |
Angular velocity (rad/s)
Definition at line 124 of file OrbitalModule.hpp.
Referenced by getOrbitSpeed(), and setOrbitSpeed().
|
private |
Entity to orbit around.
Definition at line 122 of file OrbitalModule.hpp.
Referenced by getParentEntityId(), and setParentEntityId().