My Project
|
You derive a concrete implementation of this interface in order to serve Terrains up to a TerrainLattice. More...
#include <TerrainLattice.h>
Public Member Functions | |
virtual Terrain * | LoadTerrainAt (Terrain *pTerrain, int latticeX, int latticeY, bool useGeoMipmap=false)=0 |
Called by the TerrainLattice when a Terrain object in the lattice has entered the visible region and, therefore, needs to be loaded into RAM. | |
virtual void | UnloadTerrain (int latticeX, int latticeY, Terrain *pTerrain)=0 |
Called by the TerrainLattice when a Terrain object in the lattice is no longer within the visible region and can, therefore, be disposed of, freeing RAM for other visible Terrain objects. | |
virtual float | GetTerrainWidth ()=0 |
Returns the width in world units of each of the individual Terrain objects in the lattice (they must all be the same width.) | |
virtual float | GetTerrainHeight ()=0 |
Returns the height in world units of each of the individual Terrain objects in the lattice (they must all be the same height.) | |
virtual bool | UpdateTileConfigFile (int x, int y, const string &sTileConfigFile)=0 |
update the tile config file for the terrain terrain tile x,y. More... | |
virtual bool | SaveWorldConfigFile ()=0 |
save world config file to disk. More... | |
You derive a concrete implementation of this interface in order to serve Terrains up to a TerrainLattice.
TerrainLattice is a grid of Terrain objects that are stitched together and kept seamless, even under dynamic tessellation. TerrainLattice needs to be fed each of the Terrain objects at each x,y position in the lattice as the user's camera moves around the scene and Terrains become visible. When the camera moves in such a way that a Terrain in the lattice becomes visible, your object's LoadTerrainAt() method will be called. You must load a Terrain by whatever means you like (e.g. using ElevationLoader and TextureLoader objects, or raw arrays of data, etc.) and return that Terrain so that TerrainLattice can make it visible to the user. You may also want to load other application-specific objects at this time (such as the buildings, etc. that populate the loaded Terrain - anything that is specific to THAT Terrain.) When a TerrainObject is no longer visible, your object's UnloadTerrain() method will be called, giving you a chance to dispose of the Terrain and any application-specific objects.
|
pure virtual |
save world config file to disk.
Implemented in ParaTerrain::CDynamicTerrainLoader.
|
pure virtual |
update the tile config file for the terrain terrain tile x,y.
return true if succeeded. One needs to SaveWorldConfigFile() in order for the changes to be written to disk.
sTileConfigFile | if "", it will erase the tile. otherwise it will change the config file. |
Implemented in ParaTerrain::CDynamicTerrainLoader.