Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Ogre::TerrainPage Class Reference

Groups a number of TerrainRenderables (tiles) into a page, which is the unit of loading / unloading. More...

#include <OgreTerrainPage.h>

List of all members.

Public Types

typedef std::vector< TerrainRenderable * > TerrainRow
typedef std::vector< TerrainRowTerrain2D

Public Member Functions

 TerrainPage (unsigned short numTiles)
 The main constructor.

virtual ~TerrainPage ()
 Destructor, will organise the deletion of pages.

void linkNeighbours (void)
 After TerrainRenderables have been populated, this method adds the neighbour links.

TerrainRenderablegetTerrainTile (const Vector3 &pt)
 Returns the TerrainRenderable that contains the given pt.

void setRenderQueue (uint8 qid)
 Sets the render queue group which the tiles should be rendered in.


Public Attributes

Terrain2D tiles
 2-dimensional vector of tiles, pre-allocated to the correct size

unsigned short tilesPerPage
 The number of tiles across a page.

SceneNodepageSceneNode
 The scene node to which all the tiles for this page are attached.


Detailed Description

Groups a number of TerrainRenderables (tiles) into a page, which is the unit of loading / unloading.

Remarks:
Note that this class, whilst holding onto TerrainRenderable instances, does not actually process or initialise them itself - this is intentional so the TerrainPageSource which is providing the tiles is able to load and prepare each renderable incrementally if required, thus avoiding any 'single hit' load methods for the page.
All this class does do is pre-create a 2D vector of 'slots' in which to place the TerrainRenderable pointers, which it does on construction. Note that this structure is public to allow completely free access to users of this class.

Definition at line 47 of file OgreTerrainPage.h.


Member Typedef Documentation

typedef std::vector< TerrainRow > Ogre::TerrainPage::Terrain2D
 

Definition at line 51 of file OgreTerrainPage.h.

typedef std::vector< TerrainRenderable * > Ogre::TerrainPage::TerrainRow
 

Definition at line 50 of file OgreTerrainPage.h.


Constructor & Destructor Documentation

Ogre::TerrainPage::TerrainPage unsigned short  numTiles  ) 
 

The main constructor.

Parameters:
numTiles The number of terrain tiles (TerrainRenderable) across (and down) a page

virtual Ogre::TerrainPage::~TerrainPage  )  [virtual]
 

Destructor, will organise the deletion of pages.


Member Function Documentation

TerrainRenderable* Ogre::TerrainPage::getTerrainTile const Vector3 pt  ) 
 

Returns the TerrainRenderable that contains the given pt.

If no tile exists at the point, it returns 0;

void Ogre::TerrainPage::linkNeighbours void   ) 
 

After TerrainRenderables have been populated, this method adds the neighbour links.

Remarks:
Should be called before adding the page to the scene manager.

void Ogre::TerrainPage::setRenderQueue uint8  qid  ) 
 

Sets the render queue group which the tiles should be rendered in.


Member Data Documentation

SceneNode* Ogre::TerrainPage::pageSceneNode
 

The scene node to which all the tiles for this page are attached.

Definition at line 58 of file OgreTerrainPage.h.

Terrain2D Ogre::TerrainPage::tiles
 

2-dimensional vector of tiles, pre-allocated to the correct size

Definition at line 54 of file OgreTerrainPage.h.

unsigned short Ogre::TerrainPage::tilesPerPage
 

The number of tiles across a page.

Definition at line 56 of file OgreTerrainPage.h.


The documentation for this class was generated from the following file:

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:48:12 2006