OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
This class is the 'core' class for paging terrain, that will integrate with the larger paging system and provide the appropriate utility classes required. More...
#include <OgreTerrainPaging.h>
Public Member Functions | |
TerrainPaging (PageManager *pageMgr) | |
Constructor. | |
virtual | ~TerrainPaging () |
TerrainPagedWorldSection * | createWorldSection (PagedWorld *world, TerrainGroup *terrainGroup, Real loadRadius, Real holdRadius, int32 minX=-10, int32 minY=-10, int32 maxX=10, int32 maxY=10, const String §ionName=BLANKSTRING, uint32 loadingIntervalMs=900) |
Create a TerrainPagedWorldSection. | |
This class is the 'core' class for paging terrain, that will integrate with the larger paging system and provide the appropriate utility classes required.
You should construct this class after PageManager and before any PagedWorlds that might use it are created / loaded. Once constructed, it will make the "Terrain" PagedWorldSection type available, which uses a grid strategy for paging and uses TerrainGroup for the content. Other content can be embedded in the pages too but the terrain is done like this in order to maintain connections between pages and other global data.
Ogre::TerrainPaging::TerrainPaging | ( | PageManager * | pageMgr | ) |
Constructor.
pageMgr | The PageManager which this class should attach to. |
|
virtual |
TerrainPagedWorldSection * Ogre::TerrainPaging::createWorldSection | ( | PagedWorld * | world, |
TerrainGroup * | terrainGroup, | ||
Real | loadRadius, | ||
Real | holdRadius, | ||
int32 | minX = -10 , |
||
int32 | minY = -10 , |
||
int32 | maxX = 10 , |
||
int32 | maxY = 10 , |
||
const String & | sectionName = BLANKSTRING , |
||
uint32 | loadingIntervalMs = 900 |
||
) |
Create a TerrainPagedWorldSection.
This is the simplest way to create a world section which is configured to contain terrain (among other objects if you want). You can also do this by calling PagedWorld::createSection with the type "Terrain" but there are more steps to configuring it that way (note: this is how loading works though so it remains generic).
world | The PagedWorld that is to contain this section |
terrainGroup | A TerrainGroup which must have been pre-configured before this call, to at least set the origin, the world size, and the file name convention. |
loadRadius | The radius from the camera at which terrain pages will be loaded |
holdRadius | The radius from the camera at which terrain pages will be held in memory but not loaded if they're not already. This must be larger than loadRadius and is used to minimise thrashing if the camera goes backwards and forwards at the loading border. |
minX,minY,maxX,maxY | The min/max page indexes that the world will try to load pages for, as measured from the origin page at (0,0) by a signed index. The default is -10 to 10 in each direction or 20x20 pages. |
sectionName | An optional name to give the section (if none is provided, one will be generated) |
loadingIntervalMs | An optional interval in milliseconds to wait between loading single pages. The default is 900 ms. |