Simulator::cPlanetModel class

Base classes

class App::IMessageListener
An interface that can receive messages sent through the app.
class cStrategy

Public types

struct cBoundaryPointInfo
struct cCubeCornerHash
struct cCubeMapIndexEqual
struct cLandTradeRoute

Public static functions

static auto Get() -> cPlanetModel*

Public functions

auto IsInWater(const Vector3& position) -> bool
Returns true if the given position is above or inside the water mass in the planet.
auto GetNearestCity(const Vector3& position) -> cCity*
auto ToSurface(const Vector3& position) -> Vector3
Returns the position in the surface of the planet that is aligned with the center of the planet and the given position.
auto GetHeightAt(const Vector3& position) -> float
auto GetGravity() const -> float
Returns the gravity acceleration used.
auto GetOrientation(const Vector3& position, const Vector3& direction) const -> Quaternion

Public variables

cTerrainSpherePtr mpSphere
ITerrainPtr mpTerrain
float mWaterFraction
ResourceKey mPlanetKey
eastl::string16 mPlanetName
bool mbAddedMessageListeners
uint32_t* mContinentMap
eastl::vector<uint32_t> mContinentAreas
eastl::vector<bool> mContinentAboveWater
bool mContinentMapDirty
uint8_t* mObstacleBitMap
eastl::vector<cPoliticalZone> mPoliticalZones
eastl::vector<int8_t> mPoliticalZoneIdxMap
void* mPlanetRibbonGfx
eastl::vector<eastl::pair<cCity*, cCity*>> mSeaTradeRoutes
eastl::vector<eastl::pair<cCity*, cCity*>> mAirTradeRoutes
eastl::vector<cLandTradeRoute> mLandTradeRoutes
bool mSeaTradeRoutesDirty
bool mAirTradeRoutesDirty
bool mLandTradeRoutesDirty
uint32_t mGameMode

Function documentation

bool Simulator::cPlanetModel::IsInWater(const Vector3& position)

Returns true if the given position is above or inside the water mass in the planet.

To be exact, this method returns true if the water level is greater than GetHeightAt(position)

float Simulator::cPlanetModel::GetGravity() const

Returns the gravity acceleration used.

If the game is on the scenario mode, the 'scenarioGravity' will used. Otherwise, it returns -9.8