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::TerrainGrid Class Reference

Simple terrain implementation that loads cells in a grid, with no LOD. Only requested cells are loaded. More...

#include <terraingrid.hpp>

Inheritance diagram for Terrain::TerrainGrid:
Collaboration diagram for Terrain::TerrainGrid:

Public Member Functions

 TerrainGrid (osg::Group *parent, osg::Group *compileRoot, Resource::ResourceSystem *resourceSystem, Storage *storage, int nodeMask, int preCompileMask=~0, int borderMask=0)
 
 ~TerrainGrid ()
 
virtual void cacheCell (View *view, int x, int y)
 
virtual void loadCell (int x, int y)
 
virtual void unloadCell (int x, int y)
 
ViewcreateView ()
 
- Public Member Functions inherited from Terrain::World
 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 enable (bool enabled)
 
virtual void setBordersVisible (bool visible)
 
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 ()
 

Private Member Functions

osg::ref_ptr< osg::Node > buildTerrain (osg::Group *parent, float chunkSize, const osg::Vec2f &chunkCenter)
 

Private Attributes

unsigned int mNumSplits
 
MWRender::CellBorder::CellGrid mGrid
 

Additional Inherited Members

- Protected Attributes inherited from Terrain::World
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

Simple terrain implementation that loads cells in a grid, with no LOD. Only requested cells are loaded.

Constructor & Destructor Documentation

Terrain::TerrainGrid::TerrainGrid ( osg::Group *  parent,
osg::Group *  compileRoot,
Resource::ResourceSystem resourceSystem,
Storage storage,
int  nodeMask,
int  preCompileMask = ~0,
int  borderMask = 0 
)
Terrain::TerrainGrid::~TerrainGrid ( )

Here is the call graph for this function:

Member Function Documentation

osg::ref_ptr< osg::Node > Terrain::TerrainGrid::buildTerrain ( osg::Group *  parent,
float  chunkSize,
const osg::Vec2f &  chunkCenter 
)
private

Here is the caller graph for this function:

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

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

Note
Thread safe.

Reimplemented from Terrain::World.

Here is the call graph for this function:

View * Terrain::TerrainGrid::createView ( )
virtual

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

Note
Thread safe.

Reimplemented from Terrain::World.

void Terrain::TerrainGrid::loadCell ( int  x,
int  y 
)
virtual
Note
Not thread safe.

Reimplemented from Terrain::World.

Here is the call graph for this function:

void Terrain::TerrainGrid::unloadCell ( int  x,
int  y 
)
virtual
Note
Not thread safe.

Reimplemented from Terrain::World.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

MWRender::CellBorder::CellGrid Terrain::TerrainGrid::mGrid
private
unsigned int Terrain::TerrainGrid::mNumSplits
private

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