Terrain LOD data manager. More...
#include <OgreTerrainLodManager.h>
Classes | |
struct | LoadLodRequest |
struct | LodInfo |
Public Types | |
typedef vector< float >::type | LodData |
typedef vector< LodData >::type | LodsData |
Public Member Functions | |
TerrainLodManager (Terrain *t, DataStreamPtr &stream) | |
TerrainLodManager (Terrain *t, const String &filename="") | |
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 () |
LodInfo & | getLodInfo (uint lodLevel) |
int | getTargetLodLevel () |
virtual WorkQueue::Response * | handleRequest (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, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
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 * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
void * | operator new[] (size_t sz) |
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 |
Private Member Functions | |
void | buildLodInfoTable () |
void | init () |
Static Private Member Functions | |
static void | separateData (float *data, uint16 size, uint16 numLodLevels, LodsData &lods) |
Separate geometry data by LOD level. More... | |
Private Attributes | |
DataStreamPtr | mDataStream |
int | mHighestLodLoaded |
Highest LOD level stored in memory i.e. mHeightData/mDeltaData. More... | |
int | mHighestLodPrepared |
Which LOD level is demanded. More... | |
bool | mIncreaseLodLevelInProgress |
Highest LOD level loaded in GPU. More... | |
bool | mLastRequestSynchronous |
Is increaseLodLevel() running? More... | |
LodInfo * | mLodInfoTable |
size_t | mStreamOffset |
int | mTargetLodLevel |
Terrain * | mTerrain |
uint16 | mWorkQueueChannel |
Terrain LOD data manager.
Definition at line 52 of file OgreTerrainLodManager.h.
typedef vector<float>::type Ogre::TerrainLodManager::LodData |
Definition at line 57 of file OgreTerrainLodManager.h.
typedef vector<LodData>::type Ogre::TerrainLodManager::LodsData |
Definition at line 58 of file OgreTerrainLodManager.h.
Ogre::TerrainLodManager::TerrainLodManager | ( | Terrain * | t, |
DataStreamPtr & | stream | ||
) |
|
virtual |
|
private |
|
virtual |
Return whether this handler can process a given request.
Reimplemented from Ogre::WorkQueue::RequestHandler.
|
virtual |
Return whether this handler can process a given response.
Reimplemented from Ogre::WorkQueue::ResponseHandler.
Copy geometry data from buffer to mHeightData/mDeltaData.
lodLevel | A LOD level to work with |
data | Buffer which holds geometry data if separated form |
|
inline |
Definition at line 117 of file OgreTerrainLodManager.h.
|
inline |
Definition at line 116 of file OgreTerrainLodManager.h.
Definition at line 120 of file OgreTerrainLodManager.h.
|
inline |
Definition at line 118 of file OgreTerrainLodManager.h.
|
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.
req | The 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. |
srcQ | The work queue that this request originated from |
Implements Ogre::WorkQueue::RequestHandler.
|
virtual |
The handler method every subclass must implement.
res | The 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. |
srcQ | The work queue that this request originated from |
Implements Ogre::WorkQueue::ResponseHandler.
|
private |
|
inlineinherited |
Definition at line 96 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 102 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 108 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 113 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 119 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
operator new, with debug line info
Definition at line 68 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 73 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
placement operator new
Definition at line 79 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
array operator new, with debug line info
Definition at line 86 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 91 of file OgreMemoryAllocatedObject.h.
Read separated geometry data from file into allocated memory.
lowerLodBound | Lower bound of LOD levels to load |
higherLodBound | Upper bound of LOD levels to load |
|
static |
Save each LOD level separately compressed so seek is possible.
|
staticprivate |
Separate geometry data by LOD level.
data | A geometry data to separate i.e. mHeightData/mDeltaData |
size | Dimension of the input data |
numLodLevels | Number of LOD levels in the input data |
lods | The separated LOD data |
void Ogre::TerrainLodManager::updateToLodLevel | ( | int | lodLevel, |
bool | synchronous = false |
||
) |
void Ogre::TerrainLodManager::waitForDerivedProcesses | ( | ) |
|
private |
Definition at line 150 of file OgreTerrainLodManager.h.
|
private |
Highest LOD level stored in memory i.e. mHeightData/mDeltaData.
Definition at line 157 of file OgreTerrainLodManager.h.
|
private |
Which LOD level is demanded.
Definition at line 156 of file OgreTerrainLodManager.h.
|
private |
Highest LOD level loaded in GPU.
Definition at line 159 of file OgreTerrainLodManager.h.
|
private |
Is increaseLodLevel() running?
Definition at line 160 of file OgreTerrainLodManager.h.
|
private |
Definition at line 154 of file OgreTerrainLodManager.h.
|
private |
Definition at line 151 of file OgreTerrainLodManager.h.
|
private |
Definition at line 155 of file OgreTerrainLodManager.h.
|
private |
Definition at line 149 of file OgreTerrainLodManager.h.
|
private |
Definition at line 152 of file OgreTerrainLodManager.h.
|
static |
Definition at line 55 of file OgreTerrainLodManager.h.
|
static |
Definition at line 56 of file OgreTerrainLodManager.h.
|
static |
Definition at line 90 of file OgreTerrainLodManager.h.