Manages Terrain objects and their associated keys.
More...
#include <TerrainObjectManager.h>
|
static Terrain * | Get (MapKey key) |
| Retrieves a Terrain object by its key.
|
|
static void | Load (MapKey key, Terrain *t) |
| Loads a Terrain object directly.
|
|
static void | Load (MapKey key, std::string heightmap, float sideLen, float maxH, float zeroAltitude, std::string tex, float uRep, float vRep) |
| Loads a Terrain object from parameters.
|
|
|
static const MapKey | defaultTerrainKey = AssetDefaults::DefaultTerrainKey |
| Default key for the default Terrain.
|
|
|
std::map< MapKey, Terrain * > | storageMap |
| Map storing Terrain objects associated with their keys.
|
|
|
class | TerrainObjectManagerAttorney |
|
Manages Terrain objects and their associated keys.
The TerrainObjectManager is a singleton class responsible for loading, retrieving, and managing Terrain objects in the game engine. It uses a map to associate keys with Terrain objects, allowing for easy access and management of multiple terrains.
◆ Get()
static Terrain * TerrainObjectManager::Get |
( |
MapKey | key | ) |
|
|
inlinestatic |
Retrieves a Terrain object by its key.
- Parameters
-
key | The key associated with the Terrain object. |
- Returns
- A pointer to the Terrain object, or nullptr if the key is not found.
◆ Load() [1/2]
static void TerrainObjectManager::Load |
( |
MapKey | key, |
|
|
std::string | heightmap, |
|
|
float | sideLen, |
|
|
float | maxH, |
|
|
float | zeroAltitude, |
|
|
std::string | tex, |
|
|
float | uRep, |
|
|
float | vRep ) |
|
inlinestatic |
Loads a Terrain object from parameters.
- Parameters
-
key | The key to associate with the Terrain object. |
heightmap | The heightmap file path. |
sideLen | The side length of the terrain. |
maxH | The maximum height of the terrain. |
zeroAltitude | The zero altitude of the terrain. |
tex | The texture file path. |
uRep | The U texture repeat factor. |
vRep | The V texture repeat factor. |
◆ Load() [2/2]
static void TerrainObjectManager::Load |
( |
MapKey | key, |
|
|
Terrain * | t ) |
|
inlinestatic |
Loads a Terrain object directly.
- Parameters
-
key | The key to associate with the Terrain object. |
t | A pointer to the Terrain object. |
The documentation for this class was generated from the following files: