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

The basic interface for a terrain world. How the terrain chunks are paged and displayed is up to the implementation. More...

#include <world.hpp>

Inheritance diagram for Terrain::World:
Collaboration diagram for Terrain::World:

Public Member Functions

 World (osg::Group *parent, osg::Group *compileRoot, Resource::ResourceSystem *resourceSystem, Storage *storage, int nodeMask, int preCompileMask, int borderMask)
 
virtual ~World ()
 
void setTargetFrameRate (float rate)
 See CompositeMapRenderer::setTargetFrameRate. More...
 
void updateTextureFiltering ()
 
float getHeightAt (const osg::Vec3f &worldPos)
 
virtual void clearAssociatedCaches ()
 
virtual void cacheCell (View *view, int x, int y)
 
virtual void loadCell (int x, int y)
 
virtual void unloadCell (int x, int y)
 
virtual void enable (bool enabled)
 
virtual void setBordersVisible (bool visible)
 
virtual ViewcreateView ()
 
virtual void preload (View *view, const osg::Vec3f &eyePoint)
 
virtual void reportStats (unsigned int frameNumber, osg::Stats *stats)
 
virtual void setDefaultViewer (osg::Object *obj)
 Set the default viewer (usually a Camera), used as viewpoint for any viewers that don't use their own viewpoint. More...
 
StoragegetStorage ()
 

Protected Attributes

StoragemStorage
 
osg::ref_ptr< osg::Group > mParent
 
osg::ref_ptr< osg::Group > mTerrainRoot
 
osg::ref_ptr< osg::Group > mCompositeMapCamera
 
osg::ref_ptr
< CompositeMapRenderer
mCompositeMapRenderer
 
Resource::ResourceSystemmResourceSystem
 
std::unique_ptr< TextureManagermTextureManager
 
std::unique_ptr< ChunkManagermChunkManager
 
std::unique_ptr
< MWRender::CellBorder
mCellBorder
 
bool mBorderVisible
 
std::set< std::pair< int, int > > mLoadedCells
 

Detailed Description

The basic interface for a terrain world. How the terrain chunks are paged and displayed is up to the implementation.

Constructor & Destructor Documentation

Terrain::World::World ( osg::Group *  parent,
osg::Group *  compileRoot,
Resource::ResourceSystem resourceSystem,
Storage storage,
int  nodeMask,
int  preCompileMask,
int  borderMask 
)
Note
takes ownership of storage
Parameters
storageStorage instance to get terrain data from (heights, normals, colors, textures..)
nodeMaskmask for the terrain root
preCompileMaskmask for pre compiling textures

Here is the call graph for this function:

Terrain::World::~World ( )
virtual

Here is the call graph for this function:

Member Function Documentation

virtual void Terrain::World::cacheCell ( View view,
int  x,
int  y 
)
inlinevirtual

Load a terrain cell at maximum LOD and store it in the View for later use.

Note
Thread safe.

Reimplemented in Terrain::QuadTreeWorld, and Terrain::TerrainGrid.

Here is the caller graph for this function:

void Terrain::World::clearAssociatedCaches ( )
virtual

Clears the cached land and landtexture data.

Note
Thread safe.
virtual View* Terrain::World::createView ( )
inlinevirtual

Create a View to use with preload feature. The caller is responsible for deleting the view.

Note
Thread safe.

Reimplemented in Terrain::QuadTreeWorld, and Terrain::TerrainGrid.

Here is the caller graph for this function:

virtual void Terrain::World::enable ( bool  enabled)
inlinevirtual

Reimplemented in Terrain::QuadTreeWorld.

float Terrain::World::getHeightAt ( const osg::Vec3f &  worldPos)

Here is the call graph for this function:

Here is the caller graph for this function:

Storage* Terrain::World::getStorage ( )
inline
void Terrain::World::loadCell ( int  x,
int  y 
)
virtual

Load the cell into the scene graph.

Note
Not thread safe.

Reimplemented in Terrain::TerrainGrid.

virtual void Terrain::World::preload ( View view,
const osg::Vec3f &  eyePoint 
)
inlinevirtual
Note
Thread safe, as long as you do not attempt to load into the same view from multiple threads.

Reimplemented in Terrain::QuadTreeWorld.

Here is the caller graph for this function:

virtual void Terrain::World::reportStats ( unsigned int  frameNumber,
osg::Stats *  stats 
)
inlinevirtual

Reimplemented in Terrain::QuadTreeWorld.

void Terrain::World::setBordersVisible ( bool  visible)
virtual
virtual void Terrain::World::setDefaultViewer ( osg::Object *  obj)
inlinevirtual

Set the default viewer (usually a Camera), used as viewpoint for any viewers that don't use their own viewpoint.

Reimplemented in Terrain::QuadTreeWorld.

void Terrain::World::setTargetFrameRate ( float  rate)
void Terrain::World::unloadCell ( int  x,
int  y 
)
virtual

Remove the cell from the scene graph.

Note
Not thread safe.

Reimplemented in Terrain::TerrainGrid.

Here is the caller graph for this function:

void Terrain::World::updateTextureFiltering ( )

Apply the scene manager's texture filtering settings to all cached textures.

Note
Thread safe.

Member Data Documentation

bool Terrain::World::mBorderVisible
protected
std::unique_ptr<MWRender::CellBorder> Terrain::World::mCellBorder
protected
std::unique_ptr<ChunkManager> Terrain::World::mChunkManager
protected
osg::ref_ptr<osg::Group> Terrain::World::mCompositeMapCamera
protected
osg::ref_ptr<CompositeMapRenderer> Terrain::World::mCompositeMapRenderer
protected
std::set<std::pair<int,int> > Terrain::World::mLoadedCells
protected
osg::ref_ptr<osg::Group> Terrain::World::mParent
protected
Resource::ResourceSystem* Terrain::World::mResourceSystem
protected
Storage* Terrain::World::mStorage
protected
osg::ref_ptr<osg::Group> Terrain::World::mTerrainRoot
protected
std::unique_ptr<TextureManager> Terrain::World::mTextureManager
protected

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