Terrain::ITerrain class

Derived classes

class cTerrainSphere

Public types

enum class DisplayType { Creature = 0, Tribe = 1, Civ = 2, Space = 3, Default = 4 }
using OnLoadFinish_t = void(*)(ITerrain*, void*)

Public static variables

static const uint32_t WORLD_ID

Public functions

auto AddRef() -> int pure virtual
auto Release() -> int pure virtual
auto GetPropertyList() -> App::PropertyList* pure virtual
Returns the property list used to generate this planet.
auto GetTerrainMapSet() -> cTerrainMapSet* pure virtual
auto GetTerrainStateManager() -> cTerrainStateMgr* pure virtual
auto GetWeatherManager() -> cWeatherManager* pure virtual
auto GetSeed() -> uint32_t pure virtual
Returns the seed that was used to create this planet.
void SetDisplayType(DisplayType pathType) pure virtual
auto GetDisplayType() -> DisplayType pure virtual
void func24h(Object*) pure virtual
auto func28h() -> Object* pure virtual
auto HasViewer() -> bool pure virtual
auto IsLoading() -> bool pure virtual
auto GetLoadMode() -> int pure virtual
void SetOnLoadFinish(OnLoadFinish_t f, void* object) pure virtual
Sets a function that will be executed when the planet finishes loading.
void ForceLoadEnd() pure virtual
void func40h() pure virtual
void func44h(bool) pure virtual
auto func48h(uint8_t) -> uint8_t pure virtual
auto func4Ch(bool) -> bool pure virtual
auto func50h() -> bool pure virtual
auto AddModelModification(const Transform& transform, App::PropertyList* propList) -> uint32_t pure virtual
auto RemoveModelModification(uint32_t modid, bool) -> bool pure virtual
auto HasModelModification(uint32_t modid) -> bool pure virtual
auto ResetModelModifications() -> int pure virtual
auto AddPlayerModification(const Transform& transform, uint32_t effectID, uint32_t groupID = 0) -> uint32_t pure virtual
auto RemovePlayerModification(uint32_t modid) -> bool pure virtual
auto HasPlayerModification(uint32_t modid) -> bool pure virtual
void ResetPlayerModifications() pure virtual
void SetPlanetInfo(int terrainType, int atmosphereType, int waterType) pure virtual
void GetPlanetInfo(int* dstTerrainType, int* dstAtmosphereType, int* dstWaterType) pure virtual
void func7Ch(int terrainType, int atmosphereType, int waterType, Vector3*, Vector3*, Vector3*) pure virtual
void func80h() pure virtual
void func84h() pure virtual
void func88h() pure virtual
auto AddToRender(Graphics::IRenderManager*) -> bool pure virtual
void RemoveFromRender(Graphics::IRenderManager*) pure virtual
auto IsAddedToRender(Graphics::IRenderManager*) -> bool pure virtual
void SetVisible(bool visible) pure virtual
void Update(App::cViewer* pViewer, int deltaTime) pure virtual
void funcA0h() pure virtual
void funcA4h() pure virtual
void LoadAssets() pure virtual
Loads the ambient effects and terrain models, only if they are not loaded already.
void UnloadAssets() pure virtual
Unloads the ambient effects and terrain models.
auto GetModels(ModelPtr*& dst) -> size_t pure virtual
Used to get the loaded planet asset models. Returns the number of models.
auto GetModelsInfo(ResourceKey** dstKeys, Transform** dstTransforms) -> size_t pure virtual
auto funcB8h(int) -> int pure virtual
auto funcBCh(int) -> int pure virtual
auto funcC0h(int) -> int pure virtual
auto funcC4h(int) -> int pure virtual
auto funcC8h() -> size_t pure virtual
auto funcCCh() -> int pure virtual
auto funcD0h() -> int pure virtual
void funcD4h(float) pure virtual
auto funcD8h() -> bool pure virtual
auto GetAllowUnderwaterObjects() -> bool pure virtual
void SetAllowUnderwaterObjects(bool) pure virtual
void AddUnderwaterModelWorld(Graphics::IModelWorld* world, int flags = 0) pure virtual
void RemoveUnderwaterModelWorld(Graphics::IModelWorld*) pure virtual
void ClearUnderwaterModelWorlds() pure virtual
void AddUnderwaterAnimWorld(Anim::IAnimWorld* world, int flags) pure virtual
void RemoveUnderwaterAnimWorld(Anim::IAnimWorld*) pure virtual
void ClearUnderwaterAnimWorlds() pure virtual
auto GetGrassTrampling() -> Vector4* pure virtual
auto GetMaxGrassTrampling() -> int pure virtual
void ResetGrassTrampling() pure virtual
auto Raycast(const Vector3& pos, const Vector3& dir) -> Vector3 pure virtual
Finds the first point in the terrain surface that intersects with a ray in position pos towards direction dir.
auto GetOrientation(const Vector3& upAxis) -> Quaternion pure virtual
void Dispose() pure virtual
void ParseProp(App::PropertyList* pPropList) pure virtual
auto GetCameraPos() -> const Vector3& pure virtual
auto GetCameraDir() -> const Vector3& pure virtual
auto GetSunDir() -> const Vector3& pure virtual
auto LoadInternal(bool weather) -> bool pure virtual
auto Load() -> bool pure virtual

Function documentation

uint32_t Terrain::ITerrain::GetSeed() pure virtual

Returns the seed that was used to create this planet.

The seed is determined by the modelEffectSeed property; if the property isn't specified, the planet instance ID is used as seed.

void Terrain::ITerrain::SetOnLoadFinish(OnLoadFinish_t f, void* object) pure virtual

Sets a function that will be executed when the planet finishes loading.

Parameters
f
object

If it has already finished, the function will be executed immediately. The object is passed as parameter to the function.

void Terrain::ITerrain::LoadAssets() pure virtual

Loads the ambient effects and terrain models, only if they are not loaded already.

You can force a reload by calling UnloadAssets() first.

Vector3 Terrain::ITerrain::Raycast(const Vector3& pos, const Vector3& dir) pure virtual

Finds the first point in the terrain surface that intersects with a ray in position pos towards direction dir.

Parameters
pos The start position of the ray.
dir The direction of the ray.
Returns The position of the terrain where the ray hit, or (0,0,0) if there was no intersection with the planet.

This only takes the terrain into acount, so it ignores models and water.