OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::TerrainLodManager Class Reference

Terrain LOD data manager. More...

#include <OgreTerrainLodManager.h>

+ Inheritance diagram for Ogre::TerrainLodManager:

Classes

struct  LoadLodRequest
 
struct  LodInfo
 

Public Types

typedef vector< float >::type LodData
 
typedef vector< LodData >::type LodsData
 

Public Member Functions

 TerrainLodManager (Terrain *t, const String &filename="")
 
 TerrainLodManager (Terrain *t, DataStreamPtr &stream)
 
virtual ~TerrainLodManager ()
 
virtual bool canHandleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ)
 Return whether this handler can process a given request. More...
 
virtual bool canHandleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ)
 Return whether this handler can process a given response. More...
 
void fillBufferAtLod (uint lodLevel, const float *data, uint dataSize)
 Copy geometry data from buffer to mHeightData/mDeltaData. More...
 
int getHighestLodLoaded ()
 
int getHighestLodPrepared ()
 
LodInfogetLodInfo (uint lodLevel)
 
int getTargetLodLevel ()
 
virtual WorkQueue::ResponsehandleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ)
 The handler method every subclass must implement. More...
 
virtual void handleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ)
 The handler method every subclass must implement. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void readLodData (uint16 lowerLodBound, uint16 higherLodBound)
 Read separated geometry data from file into allocated memory. More...
 
void updateToLodLevel (int lodLevel, bool synchronous=false)
 
void waitForDerivedProcesses ()
 

Static Public Member Functions

static void saveLodData (StreamSerialiser &stream, Terrain *terrain)
 Save each LOD level separately compressed so seek is possible. More...
 

Static Public Attributes

static const uint32 TERRAINLODDATA_CHUNK_ID
 
static const uint16 TERRAINLODDATA_CHUNK_VERSION
 
static const uint16 WORKQUEUE_LOAD_LOD_DATA_REQUEST
 

Detailed Description

Terrain LOD data manager.

This class is used for managing terrain LOD data's loading, unloading.

Member Typedef Documentation

◆ LodData

typedef vector<float>::type Ogre::TerrainLodManager::LodData

◆ LodsData

Constructor & Destructor Documentation

◆ TerrainLodManager() [1/2]

Ogre::TerrainLodManager::TerrainLodManager ( Terrain t,
DataStreamPtr stream 
)

◆ TerrainLodManager() [2/2]

Ogre::TerrainLodManager::TerrainLodManager ( Terrain t,
const String filename = "" 
)

◆ ~TerrainLodManager()

virtual Ogre::TerrainLodManager::~TerrainLodManager ( )
virtual

Member Function Documentation

◆ canHandleRequest()

virtual bool Ogre::TerrainLodManager::canHandleRequest ( const WorkQueue::Request req,
const WorkQueue srcQ 
)
virtual

Return whether this handler can process a given request.

Remarks
Defaults to true, but if you wish to add several handlers each of which deal with different types of request, you can override this method.

Reimplemented from Ogre::WorkQueue::RequestHandler.

◆ canHandleResponse()

virtual bool Ogre::TerrainLodManager::canHandleResponse ( const WorkQueue::Response res,
const WorkQueue srcQ 
)
virtual

Return whether this handler can process a given response.

Remarks
Defaults to true, but if you wish to add several handlers each of which deal with different types of response, you can override this method.

Reimplemented from Ogre::WorkQueue::ResponseHandler.

◆ fillBufferAtLod()

void Ogre::TerrainLodManager::fillBufferAtLod ( uint  lodLevel,
const float *  data,
uint  dataSize 
)

Copy geometry data from buffer to mHeightData/mDeltaData.

Parameters
lodLevelA LOD level to work with
dataBuffer which holds geometry data if separated form
Remarks
Data in buffer has to be both height and delta data. First half is height data. Seconds half is delta data.

◆ getHighestLodLoaded()

int Ogre::TerrainLodManager::getHighestLodLoaded ( )
inline

◆ getHighestLodPrepared()

int Ogre::TerrainLodManager::getHighestLodPrepared ( )
inline

◆ getLodInfo()

LodInfo& Ogre::TerrainLodManager::getLodInfo ( uint  lodLevel)
inline

◆ getTargetLodLevel()

int Ogre::TerrainLodManager::getTargetLodLevel ( )
inline

◆ handleRequest()

virtual WorkQueue::Response* Ogre::TerrainLodManager::handleRequest ( const WorkQueue::Request req,
const WorkQueue srcQ 
)
virtual

The handler method every subclass must implement.

If a failure is encountered, return a Response with a failure result rather than raise an exception.

Parameters
reqThe Request structure, which is effectively owned by the handler during this call. It must be attached to the returned Response regardless of success or failure.
srcQThe work queue that this request originated from
Returns
Pointer to a Response object - the caller is responsible for deleting the object.

Implements Ogre::WorkQueue::RequestHandler.

◆ handleResponse()

virtual void Ogre::TerrainLodManager::handleResponse ( const WorkQueue::Response res,
const WorkQueue srcQ 
)
virtual

The handler method every subclass must implement.

Parameters
resThe Response structure. The caller is responsible for deleting this after the call is made, none of the data contained (except pointers to structures in user Any data) will persist after this call is returned.
srcQThe work queue that this request originated from

Implements Ogre::WorkQueue::ResponseHandler.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

◆ readLodData()

void Ogre::TerrainLodManager::readLodData ( uint16  lowerLodBound,
uint16  higherLodBound 
)

Read separated geometry data from file into allocated memory.

Parameters
lowerLodBoundLower bound of LOD levels to load
higherLodBoundUpper bound of LOD levels to load
Remarks
Geometry data are uncompressed using inflate() and stored into allocated buffer

◆ saveLodData()

static void Ogre::TerrainLodManager::saveLodData ( StreamSerialiser stream,
Terrain terrain 
)
static

Save each LOD level separately compressed so seek is possible.

◆ updateToLodLevel()

void Ogre::TerrainLodManager::updateToLodLevel ( int  lodLevel,
bool  synchronous = false 
)

◆ waitForDerivedProcesses()

void Ogre::TerrainLodManager::waitForDerivedProcesses ( )

Member Data Documentation

◆ TERRAINLODDATA_CHUNK_ID

const uint32 Ogre::TerrainLodManager::TERRAINLODDATA_CHUNK_ID
static

◆ TERRAINLODDATA_CHUNK_VERSION

const uint16 Ogre::TerrainLodManager::TERRAINLODDATA_CHUNK_VERSION
static

◆ WORKQUEUE_LOAD_LOD_DATA_REQUEST

const uint16 Ogre::TerrainLodManager::WORKQUEUE_LOAD_LOD_DATA_REQUEST
static

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