Simulator::cSolarSystem class

Holds visual information about a solar system in the solar system view, or when inside a planet.

In Space Stage, when inside a solar system, this class generates all what you see inside it: it generates the effects of the star/black hole/binary stars/etc, comets, and planets. Stars and comets are represented by the Simulator::cCelestialBody class, and planets by the Simulator::cPlanet class. Both classes have a Simulator::cEllipticalOrbit that describes the orbit of that celestial body or planet.

First, the solar system is generated with the cSolarSystem::Load() method using a Simulator::cStar object. This does not generate any graphics (models or effects), it just creates the

Base classes

class DefaultRefCounted
The default implementation of a reference counted class.
class ISimulatorSerializable

Public static variables

static const uint32_t TYPE
static const uint32_t NOUN_ID

Public static functions

static auto CreateStarEffect(IVisualEffectPtr& dst, Swarm::IEffectsWorld* pEffectWorld, StarType starType) -> void
Instantiates the effect of a star in the solar system view.

Public functions

auto Load(cStar* pStar) -> void
Generates all data of the solar system for the given star data.
auto LoadBinaryStar() -> void
Called by Load() only in binary systems, generates the two individual star celestial bodies.
auto LoadAsteroids() -> void
Called by Load(), generates the asteroids celestial bodies.
auto GenerateGraphics(bool create) -> void
Loads/unloads the effects and graphics of this solar system.
auto GenerateCelestialBodiesEffects(bool create, float scale) -> void
Loads/unloads the effects for the celestial bodies of this solar system.
auto AddRef() -> int pure virtual
auto Release() -> int pure virtual
auto Cast(uint32_t typeID) const -> void* pure virtual

Public variables

eastl::intrusive_ptr<cStar> mpOwnerStar
eastl::vector<cPlanetPtr> mPlanets
eastl::vector<cCelestialBodyPtr> mCelestialBodies
cCelestialBodyPtr mpStar1
cCelestialBodyPtr mpStar2
eastl::vector<ModelPtr> field_40

Function documentation

static void Simulator::cSolarSystem::CreateStarEffect(IVisualEffectPtr& dst, Swarm::IEffectsWorld* pEffectWorld, StarType starType)

Instantiates the effect of a star in the solar system view.

Parameters
dst The effect must be created into this variable.
pEffectWorld Effect world where the effect must be created.
starType The kind of star, except binary stars.

This method does nothing for binary star types, as those are two effects of their respective star types. By default, the effects are:

void Simulator::cSolarSystem::Load(cStar* pStar)

Generates all data of the solar system for the given star data.

Parameters
pStar

By default, this generates mpStar1 (and mpStar2 if it's a binary system), the asteroids, and the planets. This does not any visual effects yet, it only sets up the Simulator classes (cCelestialBody and cPlanet). Source code: cSolarSystem::Load()

void Simulator::cSolarSystem::GenerateGraphics(bool create)

Loads/unloads the effects and graphics of this solar system.

Parameters
create If true, create and load the graphics, if false, destroy them.

If create is true it must generate them, if it is false it must destroy them instead. This method must also create the cSolarHitSphere hit spheres of the celestial bodies.

void Simulator::cSolarSystem::GenerateCelestialBodiesEffects(bool create, float scale)

Loads/unloads the effects for the celestial bodies of this solar system.

Parameters
create If true, create and load the graphics, if false, destroy them.
scale The scale that will be applied to the effects.

This method generates the effect of the star (or black hole/planetary disk etc) and comets. By default, these are the effects used: