Simulator::cPlanet class

Visual representation of a planet (or asteroids).

The information of a planet is stored in the Simulator::cPlanetRecord class, but that class does not hold any visual information. Whenever a planet must be viewed (in the solar system view in Space stage, or when you see planets in the sky while you are in a planet), this cPlanet class is used. You can use the Simulator::cStarManager::RecordToPlanet() method to generate a planet from a planet record.

Base classes

class cSpatialObject
A 3D model in the Simulator.
class cGameData
Base class for most Simulator objects.

Public static variables

static const uint32_t TYPE
static const uint32_t NOUN_ID

Public functions

auto GetTemperatureScore() const -> float
Returns the temperature score of the planet record in the [0, 1] range or 0.5 if there is no planet record.
auto GetEmpire() -> cEmpire*
Returns the empire that controls this planet, if any.
auto SetRepresentationMode(PlanetRepresentationMode mode) -> void
Sets and enables the graphical representation of the planet.
auto GetRingEffect(bool isFromPlanet) -> uint32_t
Returns the ID of the effect used to display the planet ring, which depends on the cPlanetRecord::mPlanetRing field and whether it is being viewed from inside the planet, or from the solar system view.
auto AddRef() -> int pure virtual
auto Release() -> int pure virtual

Public variables

int mNumSpecializedBehaviorUFOs
Math::Matrix3 field_10C
int field_130
int field_134
int field_138
cPlanetRecordPtr mpPlanetRecord
uint32_t mPlanetKey
uint32_t mStarterWorldID
Math::Vector3 mOrbitedPlanetLastKnownPosition
eastl::intrusive_ptr<cSimPlanetLowLOD> mpPlanetSim
PlanetRepresentationMode mGraphicRepresentationMode
eastl::string16 mImpostorModel
uint32_t mEffectScript
eastl::vector<IVisualEffectPtr> mPlanetEffects
Effects created by cVisiblePlanet such as clouds, planet rings,...
float mPlanetScale
cSolarHitSpherePtr mpSolarHitSphere
cVisiblePlanetPtr mpVisiblePlanet
bool field_190
cGonzagoTimer mTimeSinceLastColonyPlaced
bool field_1B8
int mPlanetFlags
cPlanetPtr mpParent
uint32_t mSpaceEconomySpiceColor

Function documentation

void Simulator::cPlanet::SetRepresentationMode(PlanetRepresentationMode mode)

Sets and enables the graphical representation of the planet.

Parameters
mode

Depending on the type, this creates and sets visible the mpSolarHitSphere and the mpVisiblePlanet.

uint32_t Simulator::cPlanet::GetRingEffect(bool isFromPlanet)

Returns the ID of the effect used to display the planet ring, which depends on the cPlanetRecord::mPlanetRing field and whether it is being viewed from inside the planet, or from the solar system view.

Parameters
isFromPlanet True if it is being viewed from inside a planet, false otherwise.
Returns The effect ID, or 0 if no effect is desired.