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

Ogre::HeightmapTerrainPageSource Class Reference

Specialisation of the TerrainPageSource class to provide tiles loaded from a 2D greyscale image. More...

#include <OgreHeightmapTerrainPageSource.h>

Inheritance diagram for Ogre::HeightmapTerrainPageSource:

Ogre::TerrainPageSource List of all members.

Public Member Functions

 HeightmapTerrainPageSource ()
 ~HeightmapTerrainPageSource ()
void shutdown (void)
 TerrainPageSource.

void requestPage (ushort x, ushort y)
 TerrainPageSource.

void expirePage (ushort x, ushort y)
 TerrainPageSource.

void initialise (TerrainSceneManager *tsm, ushort tileSize, ushort pageSize, bool asyncLoading, TerrainPageSourceOptionList &optionList)
 TerrainPageSource.


Static Public Member Functions

void addListener (TerrainPageSourceListener *pl)
 Register a class which will be called back whenever a new page is available.

void removeListener (TerrainPageSourceListener *pl)
 Unregister a class which will be called back whenever a new page is available.


Protected Member Functions

void loadHeightmap (void)
 Load a heightmap.

void firePageConstructed (size_t pagex, size_t pagez, Real *heightData)
 Internal method for firing pageContructed events.

virtual TerrainPagebuildPage (Real *heightData, const MaterialPtr &pMaterial)
 Utility method for building a page of tiles based on some source data, wherever that may have come from.


Protected Attributes

bool mIsRaw
 Is this input RAW?

bool mFlipTerrain
 Should we flip terrain vertically?

Image mImage
 Image containing the source heightmap if loaded from non-RAW.

MemoryDataStreamPtr mRawData
 Arbitrary data loaded from RAW.

TerrainPagemPage
 The (single) terrain page this source will provide.

String mSource
 Source file name.

size_t mRawSize
 Manual size if source is RAW.

uchar mRawBpp
 Manual bpp if source is RAW.

TerrainSceneManagermSceneManager
 Link back to parent manager.

bool mAsyncLoading
 Has asynchronous loading been requested?

unsigned short mPageSize
 The expected size of the page in number of vertices.

unsigned short mTileSize
 The expected size of a tile in number of vertices.


Detailed Description

Specialisation of the TerrainPageSource class to provide tiles loaded from a 2D greyscale image.

Remarks:
This is a simple tile provider that does not support paging; it is assumed that the entire heightmap is loaded as one page.

Definition at line 40 of file OgreHeightmapTerrainPageSource.h.


Constructor & Destructor Documentation

Ogre::HeightmapTerrainPageSource::HeightmapTerrainPageSource  ) 
 

Ogre::HeightmapTerrainPageSource::~HeightmapTerrainPageSource  ) 
 


Member Function Documentation

void Ogre::TerrainPageSource::addListener TerrainPageSourceListener pl  )  [static, inherited]
 

Register a class which will be called back whenever a new page is available.

Remarks:
Since this method is static, it applies to any page source which is in active use; there is no need to register one per source.

virtual TerrainPage* Ogre::TerrainPageSource::buildPage Real heightData,
const MaterialPtr pMaterial
[protected, virtual, inherited]
 

Utility method for building a page of tiles based on some source data, wherever that may have come from.

Remarks:
It is expected that this height data is represented in the range [0..1], which will be duly scaled by the TerrainRenderables it creates.

void Ogre::HeightmapTerrainPageSource::expirePage ushort  x,
ushort  y
[virtual]
 

TerrainPageSource.

Implements Ogre::TerrainPageSource.

void Ogre::TerrainPageSource::firePageConstructed size_t  pagex,
size_t  pagez,
Real heightData
[protected, inherited]
 

Internal method for firing pageContructed events.

void Ogre::HeightmapTerrainPageSource::initialise TerrainSceneManager tsm,
ushort  tileSize,
ushort  pageSize,
bool  asyncLoading,
TerrainPageSourceOptionList optionList
[virtual]
 

TerrainPageSource.

Reimplemented from Ogre::TerrainPageSource.

void Ogre::HeightmapTerrainPageSource::loadHeightmap void   )  [protected]
 

Load a heightmap.

void Ogre::TerrainPageSource::removeListener TerrainPageSourceListener pl  )  [static, inherited]
 

Unregister a class which will be called back whenever a new page is available.

void Ogre::HeightmapTerrainPageSource::requestPage ushort  x,
ushort  y
[virtual]
 

TerrainPageSource.

Implements Ogre::TerrainPageSource.

void Ogre::HeightmapTerrainPageSource::shutdown void   )  [virtual]
 

TerrainPageSource.

Reimplemented from Ogre::TerrainPageSource.


Member Data Documentation

bool Ogre::TerrainPageSource::mAsyncLoading [protected, inherited]
 

Has asynchronous loading been requested?

Definition at line 138 of file OgreTerrainPageSource.h.

bool Ogre::HeightmapTerrainPageSource::mFlipTerrain [protected]
 

Should we flip terrain vertically?

Definition at line 46 of file OgreHeightmapTerrainPageSource.h.

Image Ogre::HeightmapTerrainPageSource::mImage [protected]
 

Image containing the source heightmap if loaded from non-RAW.

Definition at line 48 of file OgreHeightmapTerrainPageSource.h.

bool Ogre::HeightmapTerrainPageSource::mIsRaw [protected]
 

Is this input RAW?

Definition at line 44 of file OgreHeightmapTerrainPageSource.h.

TerrainPage* Ogre::HeightmapTerrainPageSource::mPage [protected]
 

The (single) terrain page this source will provide.

Definition at line 52 of file OgreHeightmapTerrainPageSource.h.

unsigned short Ogre::TerrainPageSource::mPageSize [protected, inherited]
 

The expected size of the page in number of vertices.

Definition at line 140 of file OgreTerrainPageSource.h.

uchar Ogre::HeightmapTerrainPageSource::mRawBpp [protected]
 

Manual bpp if source is RAW.

Definition at line 58 of file OgreHeightmapTerrainPageSource.h.

MemoryDataStreamPtr Ogre::HeightmapTerrainPageSource::mRawData [protected]
 

Arbitrary data loaded from RAW.

Definition at line 50 of file OgreHeightmapTerrainPageSource.h.

size_t Ogre::HeightmapTerrainPageSource::mRawSize [protected]
 

Manual size if source is RAW.

Definition at line 56 of file OgreHeightmapTerrainPageSource.h.

TerrainSceneManager* Ogre::TerrainPageSource::mSceneManager [protected, inherited]
 

Link back to parent manager.

Definition at line 136 of file OgreTerrainPageSource.h.

String Ogre::HeightmapTerrainPageSource::mSource [protected]
 

Source file name.

Definition at line 54 of file OgreHeightmapTerrainPageSource.h.

unsigned short Ogre::TerrainPageSource::mTileSize [protected, inherited]
 

The expected size of a tile in number of vertices.

Definition at line 142 of file OgreTerrainPageSource.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:47:13 2006