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 | Functions
cqsp::common::components::bodies Namespace Reference

Classes

struct  Body
 
struct  DirtyOrbit
 
struct  LightEmitter
 
struct  NautralObject
 
struct  OrbitalSystem
 An object for the children of an orbital object. More...
 
struct  Planet
 
struct  Star
 
struct  Terrain
 
struct  TerrainData
 
struct  TexturedTerrain
 

Functions

double CalculateSOI (const double &mass, const double &reference_mass, const double &sma)
 Calculates SOI More...
 
double CalculateMass (const double &GM)
 Calculates mass from gravitational constant More...
 
double GetPlanetRotationAngle (const double &time, const double &day_length, const double &offset)
 Calculates the current planet rotation angle More...
 

Function Documentation

◆ CalculateMass()

double cqsp::common::components::bodies::CalculateMass ( const double &  GM)
inline

Calculates mass from gravitational constant

Masses of bodies are described in gravitational constant because it's more accurate to describe like that

Parameters
GM
Returns

◆ CalculateSOI()

double cqsp::common::components::bodies::CalculateSOI ( const double &  mass,
const double &  reference_mass,
const double &  sma 
)
inline

Calculates SOI

Make sure the units match up

Parameters
massMass of planet/body to calculate
reference_massMass of sun/reference body
smaSemi major axis of the planet
Returns
SOI of planet

◆ GetPlanetRotationAngle()

double cqsp::common::components::bodies::GetPlanetRotationAngle ( const double &  time,
const double &  day_length,
const double &  offset 
)
inline

Calculates the current planet rotation angle

Parameters
timecurrent time in seconds
day_lengthlength of day in seconds
offsetoffset of day
Returns
Angle the planet should be in radians