Pioneer
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
StarSystemRandomGenerator Class Reference

#include <StarSystemGenerator.h>

Inheritance diagram for StarSystemRandomGenerator:
Inheritance graph
[legend]
Collaboration diagram for StarSystemRandomGenerator:
Collaboration graph
[legend]

Public Member Functions

virtual bool Apply (Random &rng, RefCountedPtr< Galaxy > galaxy, RefCountedPtr< StarSystem::GeneratorAPI > system, GalaxyGenerator::StarSystemConfig *config)
 
fixed CalcBodySatelliteShellDensity (Random &rand, SystemBody *primary, fixed &discMin, fixed &discMax)
 
SystemBodyMakeBodyInOrbitSlice (Random &rand, StarSystem::GeneratorAPI *system, SystemBody *primary, fixed min, fixed max, fixed discMax, fixed discDensity)
 
void PickPlanetType (SystemBody *sbody, Random &rand)
 
- Public Member Functions inherited from StarSystemGeneratorStage
virtual ~StarSystemGeneratorStage ()
 
virtual bool Apply (Random &rng, RefCountedPtr< Galaxy > galaxy, RefCountedPtr< StarSystem::GeneratorAPI > system, GalaxyGenerator::StarSystemConfig *config)=0
 
- Public Member Functions inherited from GalaxyGeneratorStage
virtual ~GalaxyGeneratorStage ()
 
virtual void ToJson (Json &jsonObj, RefCountedPtr< Galaxy > galaxy)
 
virtual void FromJson (const Json &jsonObj, RefCountedPtr< Galaxy > galaxy)
 

Static Public Attributes

static constexpr uint32_t BODY_SATELLITE_SALT = 0xf5123a90
 

Additional Inherited Members

- Static Public Member Functions inherited from StarSystemLegacyGeneratorBase
static void PickAtmosphere (SystemBody *sbody)
 
static void PickRings (SystemBodyData *sbody, bool forceRings=false)
 
- Protected Member Functions inherited from StarSystemLegacyGeneratorBase
fixedf< 48 > CalcHillRadius (SystemBody *sbody) const
 
- Protected Member Functions inherited from GalaxyGeneratorStage
 GalaxyGeneratorStage ()
 
void AssignToGalaxyGenerator (GalaxyGenerator *galaxyGenerator)
 
- Protected Attributes inherited from GalaxyGeneratorStage
GalaxyGeneratorm_galaxyGenerator
 
- Static Protected Attributes inherited from StarSystemLegacyGeneratorBase
static const fixed starMetallicities []
 
static const StarTypeInfo starTypeInfo []
 

Member Function Documentation

◆ Apply()

bool StarSystemRandomGenerator::Apply ( Random rng,
RefCountedPtr< Galaxy galaxy,
RefCountedPtr< StarSystem::GeneratorAPI system,
GalaxyGenerator::StarSystemConfig config 
)
virtual

Implements StarSystemGeneratorStage.

Here is the call graph for this function:

◆ CalcBodySatelliteShellDensity()

fixed StarSystemRandomGenerator::CalcBodySatelliteShellDensity ( Random rand,
SystemBody primary,
fixed discMin,
fixed discMax 
)
Here is the call graph for this function:

◆ MakeBodyInOrbitSlice()

SystemBody * StarSystemRandomGenerator::MakeBodyInOrbitSlice ( Random rand,
StarSystem::GeneratorAPI system,
SystemBody primary,
fixed  min,
fixed  max,
fixed  discMax,
fixed  discDensity 
)
Here is the call graph for this function:

◆ PickPlanetType()

void StarSystemRandomGenerator::PickPlanetType ( SystemBody sbody,
Random rand 
)

In this and following functions, we attempt to capture even a fraction of the true majesty of the infinite cosmos.

System generation is based primarily around a mass-based metric, where the total mass of a primary body determines the maximum mass of its individual satellites.

The area of a body's "orbital slice" (between itself and any neighboring bodies) informs the mass of a body to avoid obviously-unnatural configurations with high-mass bodies orbiting so closely as to perturb each others' orbits beyond what Pioneer can simulate.

A series of post-processing factors are applied to this initial maximum mass value to curve the mass factor over the entire Hill Sphere of the parent body. This reduces the incidence of "gas giant spam" and produces more perceptually-realistic arrangements of body types and masses.

Body radius and type is inferred from the mass of the body and applied based on a set of density heuristics (in PickPlanetType), and remaining body parameters are set to complete body generation.

Here is the call graph for this function:

Member Data Documentation

◆ BODY_SATELLITE_SALT

constexpr uint32_t StarSystemRandomGenerator::BODY_SATELLITE_SALT = 0xf5123a90
staticconstexpr

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