OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Terrain::ChunkManager Class Reference

Handles loading and caching of terrain chunks. More...

#include <chunkmanager.hpp>

Inheritance diagram for Terrain::ChunkManager:
Collaboration diagram for Terrain::ChunkManager:

Public Member Functions

 ChunkManager (Storage *storage, Resource::SceneManager *sceneMgr, TextureManager *textureManager, CompositeMapRenderer *renderer)
 
osg::ref_ptr< osg::Node > getChunk (float size, const osg::Vec2f &center, int lod, unsigned int lodFlags)
 
void reportStats (unsigned int frameNumber, osg::Stats *stats) const override
 
void clearCache () override
 Clear all cache entries. More...
 
void releaseGLObjects (osg::State *state) override
 
void setCullingActive (bool active)
 
- Public Member Functions inherited from Resource::ResourceManager
 ResourceManager (const VFS::Manager *vfs)
 
virtual ~ResourceManager ()
 
virtual void updateCache (double referenceTime)
 Clear cache entries that have not been referenced for longer than expiryDelay. More...
 
void setExpiryDelay (double expiryDelay)
 How long to keep objects in cache after no longer being referenced. More...
 
const VFS::ManagergetVFS () const
 

Private Member Functions

osg::ref_ptr< osg::Node > createChunk (float size, const osg::Vec2f &center, int lod, unsigned int lodFlags)
 
osg::ref_ptr< osg::Texture2D > createCompositeMapRTT ()
 
void createCompositeMapGeometry (float chunkSize, const osg::Vec2f &chunkCenter, const osg::Vec4f &texCoords, CompositeMap &map)
 
std::vector< osg::ref_ptr
< osg::StateSet > > 
createPasses (float chunkSize, const osg::Vec2f &chunkCenter, bool forCompositeMap)
 

Private Attributes

Terrain::StoragemStorage
 
Resource::SceneManagermSceneManager
 
TextureManagermTextureManager
 
CompositeMapRenderermCompositeMapRenderer
 
BufferCache mBufferCache
 
unsigned int mCompositeMapSize
 
bool mCullingActive
 

Additional Inherited Members

- Protected Attributes inherited from Resource::ResourceManager
const VFS::ManagermVFS
 
osg::ref_ptr
< Resource::ObjectCache
mCache
 
double mExpiryDelay
 

Detailed Description

Handles loading and caching of terrain chunks.

Constructor & Destructor Documentation

Terrain::ChunkManager::ChunkManager ( Storage storage,
Resource::SceneManager sceneMgr,
TextureManager textureManager,
CompositeMapRenderer renderer 
)

Member Function Documentation

void Terrain::ChunkManager::clearCache ( )
overridevirtual

Clear all cache entries.

Reimplemented from Resource::ResourceManager.

Here is the call graph for this function:

osg::ref_ptr< osg::Node > Terrain::ChunkManager::createChunk ( float  size,
const osg::Vec2f &  center,
int  lod,
unsigned int  lodFlags 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void Terrain::ChunkManager::createCompositeMapGeometry ( float  chunkSize,
const osg::Vec2f &  chunkCenter,
const osg::Vec4f &  texCoords,
CompositeMap map 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

osg::ref_ptr< osg::Texture2D > Terrain::ChunkManager::createCompositeMapRTT ( )
private

Here is the caller graph for this function:

std::vector< osg::ref_ptr< osg::StateSet > > Terrain::ChunkManager::createPasses ( float  chunkSize,
const osg::Vec2f &  chunkCenter,
bool  forCompositeMap 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

osg::ref_ptr< osg::Node > Terrain::ChunkManager::getChunk ( float  size,
const osg::Vec2f &  center,
int  lod,
unsigned int  lodFlags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Terrain::ChunkManager::releaseGLObjects ( osg::State *  state)
overridevirtual

Reimplemented from Resource::ResourceManager.

Here is the call graph for this function:

void Terrain::ChunkManager::reportStats ( unsigned int  frameNumber,
osg::Stats *  stats 
) const
overridevirtual

Reimplemented from Resource::ResourceManager.

void Terrain::ChunkManager::setCullingActive ( bool  active)

Member Data Documentation

BufferCache Terrain::ChunkManager::mBufferCache
private
CompositeMapRenderer* Terrain::ChunkManager::mCompositeMapRenderer
private
unsigned int Terrain::ChunkManager::mCompositeMapSize
private
bool Terrain::ChunkManager::mCullingActive
private
Resource::SceneManager* Terrain::ChunkManager::mSceneManager
private
Terrain::Storage* Terrain::ChunkManager::mStorage
private
TextureManager* Terrain::ChunkManager::mTextureManager
private

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