Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cqsp::core::systems::SysOrbit Class Reference

#include <sysorbit.h>

Inheritance diagram for cqsp::core::systems::SysOrbit:
cqsp::core::systems::ISimulationSystem

Classes

struct  BodyCache
 

Public Member Functions

 SysOrbit (Game &game)
 
void DoSystem () override
 
int Interval () const override
 
void Init () override
 
- Public Member Functions inherited from cqsp::core::systems::ISimulationSystem
 ISimulationSystem (Game &game)
 
virtual ~ISimulationSystem ()=default
 

Private Member Functions

void ParseOrbitTree (entt::entity parent, entt::entity body)
 
void ComputePosition (entt::entity parent, entt::entity body)
 
void LeaveSOI (const entt::entity &body, entt::entity &parent, components::types::Orbit &orb, components::types::Kinematics &pos, components::types::Kinematics &p_pos)
 Sets the SOI of the entity to the parent More...
 
bool CheckEnterSOI (const entt::entity &parent, const entt::entity &body, components::types::Kinematics &pos)
 Change the current body's SOI into a child SOI More...
 
bool CrashObject (components::types::Orbit &orb, entt::entity body, components::types::Kinematics &pos, double radius)
 Check if the entity has crashed into its parent object More...
 
void UpdateCommandQueue (components::types::Orbit &orb, entt::entity body, entt::entity parent)
 
void CalculateImpulse (components::types::Orbit &orb, entt::entity body)
 
void ParseChildren (entt::entity body)
 
void EnterSOI (entt::entity entity, entt::entity body, entt::entity parent, components::types::Orbit &orb, components::types::Kinematics &vehicle_position, const components::bodies::Body &body_comp, const components::types::Kinematics &target_position)
 
void ComputeCenters (entt::entity entity, glm::dvec3 parent_pos, glm::dvec3 future_parent_pos)
 
void CalculatePosition (entt::entity entity, components::types::Orbit &orbit, components::types::Kinematics &kinematics, components::types::FuturePosition &future_pos)
 

Private Attributes

const bool debug_prints = false
 
std::unordered_map< entt::entity, BodyCachebody_cache
 

Additional Inherited Members

- Protected Member Functions inherited from cqsp::core::systems::ISimulationSystem
GameGetGame ()
 
UniverseGetUniverse ()
 

Constructor & Destructor Documentation

◆ SysOrbit()

cqsp::core::systems::SysOrbit::SysOrbit ( Game game)
inlineexplicit

Member Function Documentation

◆ CalculateImpulse()

void cqsp::core::systems::SysOrbit::CalculateImpulse ( components::types::Orbit orb,
entt::entity  body 
)
private

Adds an impulse in the body centered inertial frame

◆ CalculatePosition()

void cqsp::core::systems::SysOrbit::CalculatePosition ( entt::entity  entity,
components::types::Orbit orbit,
components::types::Kinematics kinematics,
components::types::FuturePosition future_pos 
)
private

◆ CheckEnterSOI()

bool cqsp::core::systems::SysOrbit::CheckEnterSOI ( const entt::entity &  parent,
const entt::entity &  body,
components::types::Kinematics pos 
)
private

Change the current body's SOI into a child SOI

Parameters
universe
parent
bodyBody that we want to check if it's entering a SOI

◆ ComputeCenters()

void cqsp::core::systems::SysOrbit::ComputeCenters ( entt::entity  entity,
glm::dvec3  parent_pos,
glm::dvec3  future_parent_pos 
)
private

◆ ComputePosition()

void cqsp::core::systems::SysOrbit::ComputePosition ( entt::entity  parent,
entt::entity  body 
)
private

◆ CrashObject()

bool cqsp::core::systems::SysOrbit::CrashObject ( components::types::Orbit orb,
entt::entity  body,
components::types::Kinematics pos,
double  radius 
)
private

Check if the entity has crashed into its parent object

Parameters
universe
orb
body
parent
Returns
If the object's altitude is below the body's radius

◆ DoSystem()

void cqsp::core::systems::SysOrbit::DoSystem ( )
overridevirtual

◆ EnterSOI()

void cqsp::core::systems::SysOrbit::EnterSOI ( entt::entity  entity,
entt::entity  body,
entt::entity  parent,
components::types::Orbit orb,
components::types::Kinematics vehicle_position,
const components::bodies::Body body_comp,
const components::types::Kinematics target_position 
)
private

◆ Init()

void cqsp::core::systems::SysOrbit::Init ( )
overridevirtual

◆ Interval()

int cqsp::core::systems::SysOrbit::Interval ( ) const
inlineoverridevirtual

How often is DoSystem is run. It will be run every n number of ticks when the tick becomes a multiple of the number below. The default is 24

Reimplemented from cqsp::core::systems::ISimulationSystem.

◆ LeaveSOI()

void cqsp::core::systems::SysOrbit::LeaveSOI ( const entt::entity &  body,
entt::entity &  parent,
components::types::Orbit orb,
components::types::Kinematics pos,
components::types::Kinematics p_pos 
)
private

Sets the SOI of the entity to the parent

Parameters
universe
bodyNeeds to have a Body and Orbit parameter
pposParent position

◆ ParseChildren()

void cqsp::core::systems::SysOrbit::ParseChildren ( entt::entity  body)
private

◆ ParseOrbitTree()

void cqsp::core::systems::SysOrbit::ParseOrbitTree ( entt::entity  parent,
entt::entity  body 
)
private

◆ UpdateCommandQueue()

void cqsp::core::systems::SysOrbit::UpdateCommandQueue ( components::types::Orbit orb,
entt::entity  body,
entt::entity  parent 
)
private

Member Data Documentation

◆ body_cache

std::unordered_map<entt::entity, BodyCache> cqsp::core::systems::SysOrbit::body_cache
private

◆ debug_prints

const bool cqsp::core::systems::SysOrbit::debug_prints = false
private

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