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 TerrainGet (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

static Terrain* TerrainAssets::Get ( const TerrainKey Terrain_Map_Key)
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_KeyAn std::string for use as a key to access the stored Terrain
Returns
Pointer to Terrain object at stored key
static void TerrainAssets::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 
)
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_KeyAn std::string for use as a storage key
HeightMap_Tex_PathA wide char string for path to Heightmap (starting in the "Assets" directory)
pShaderShader pointer for the Terrain object (NOTE: only use ShaderTextureLight pointers)
Light_ColorColor vect for the color of the light
Scale_widthint for scaling the size of the terrain
Scale_heightint for scaling the highest point of the terrain.
RepeatUVint for the number of times to repeat a Texture across
pTexturepointer to the Texture to use with the terrain