Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound 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 Methods

 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.


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 46 of file OgreTerrainPage.h.


Member Typedef Documentation

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

Definition at line 50 of file OgreTerrainPage.h.

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

Definition at line 49 of file OgreTerrainPage.h.

Referenced by TerrainPage().


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

Definition at line 31 of file OgreTerrainPage.cpp.

References pageSceneNode, TerrainRow, tiles, and tilesPerPage.

Ogre::TerrainPage::~TerrainPage   [virtual]
 

Destructor, will organise the deletion of pages.

Definition at line 50 of file OgreTerrainPage.cpp.

References tiles.


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;

Definition at line 91 of file OgreTerrainPage.cpp.

References Ogre::AxisAlignedBox::getAllCorners(), tiles, Ogre::Vector3::x, and Ogre::Vector3::z.

Referenced by Ogre::TerrainSceneManager::getTerrainTile().

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.

Definition at line 67 of file OgreTerrainPage.cpp.

References tiles, and tilesPerPage.

Referenced by Ogre::TerrainPageSource::buildPage().


Member Data Documentation

SceneNode* Ogre::TerrainPage::pageSceneNode
 

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

Definition at line 57 of file OgreTerrainPage.h.

Referenced by Ogre::TerrainSceneManager::attachPage(), Ogre::TerrainPageSource::buildPage(), and TerrainPage().

Terrain2D Ogre::TerrainPage::tiles
 

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

Definition at line 53 of file OgreTerrainPage.h.

Referenced by Ogre::TerrainPageSource::buildPage(), getTerrainTile(), linkNeighbours(), TerrainPage(), and ~TerrainPage().

unsigned short Ogre::TerrainPage::tilesPerPage
 

The number of tiles across a page.

Definition at line 55 of file OgreTerrainPage.h.

Referenced by linkNeighbours(), and TerrainPage().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:50:03 2004