Simulator::cPlanetModel class

Base classes

class cStrategy

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

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