System manager for for creating and accessing Terrain objects from external resources. More...
#include <TerrainAssets.h>
Detailed Description
System manager for for creating and accessing Terrain objects from external resources.
The TerrainAssets is a singleton that allows the user to create and resuse Terrain objects throughout their code.
Terrains are created via the Load() function in the IonEngine::LoadResources() function. They can then be accessed by using the Get() function with the associated key that the user defined upon loading.
Public Types | |
typedef std::string | TerrainKey |
Static Public Member Functions | |
static void | Load (const TerrainKey &Terrain_Map_Key, const wchar_t *HeightMap_Tex_Path, ShaderBase *pShader, const Vect &Light_Color, int Scale_width, int Scale_height, int RepeatUV, Texture *pTexture) |
Function creates and saves a Terrain object. More... | |
static Terrain * | Get (const TerrainKey &Terrain_Map_Key) |
Function returns Terrain pointer based off of the passed in key. More... | |
Member Typedef Documentation
typedef std::string TerrainAssets::TerrainKey |
Typedef of an std::string for an easier to read name.
Member Function Documentation
|
inlinestatic |
Function returns Terrain pointer based off of the passed in key.
This Get() function uses it's Terrain_Map_Key parameter to search the Terrain map and return the Terrain object saved under the same key string.
- Parameters
-
Terrain_Map_Key An std::string for use as a key to access the stored Terrain
- Returns
- Pointer to Terrain object at stored key
|
inlinestatic |
Function creates and saves a Terrain object.
This Load() function creates and stores a Terrain Object based off of the HeightMap_Tex_Path parameter. The Terrain_Map_Key parameter is a key string for access later when using the Get() command.
NOTE: The file paths start within the "Assets" directory of the root project directory
- Parameters
-
Terrain_Map_Key An std::string for use as a storage key HeightMap_Tex_Path A wide char string for path to Heightmap (starting in the "Assets" directory) pShader Shader pointer for the Terrain object (NOTE: only use ShaderTextureLight pointers) Light_Color Color vect for the color of the light Scale_width int for scaling the size of the terrain Scale_height int for scaling the highest point of the terrain. RepeatUV int for the number of times to repeat a Texture across pTexture pointer to the Texture to use with the terrain