1 #ifndef COMPONENTS_TERRAIN_TERRAINGRID_H
2 #define COMPONENTS_TERRAIN_TERRAINGRID_H
36 virtual osg::ref_ptr<osg::Node>
cacheCell(
int x,
int y);
53 osg::ref_ptr<osg::Node>
buildTerrain (osg::Group* parent,
float chunkSize,
const osg::Vec2f& chunkCenter);
58 typedef std::map<std::string, osg::ref_ptr<osg::Texture2D> >
TextureCache;
62 typedef std::map<std::pair<int, int>, osg::ref_ptr<osg::Node> >
Grid;
Wrapper class that constructs and provides access to the most commonly used resource subsystems...
Definition: resourcesystem.hpp:24
Simple terrain implementation that loads cells in a grid, with no LOD.
Definition: terraingrid.hpp:27
The basic interface for a terrain world. How the terrain chunks are paged and displayed is up to the ...
Definition: world.hpp:32
Shader::ShaderManager * mShaderManager
Definition: terraingrid.hpp:72
std::map< std::string, osg::ref_ptr< osg::Texture2D > > TextureCache
Definition: terraingrid.hpp:58
Implements creation and caching of vertex buffers for terrain chunks.
Definition: buffercache.hpp:14
unsigned int mNumSplits
Definition: terraingrid.hpp:56
osg::ref_ptr< osg::Node > buildTerrain(osg::Group *parent, float chunkSize, const osg::Vec2f &chunkCenter)
Definition: terraingrid.cpp:87
OpenThreads::Mutex mGridCacheMutex
Definition: terraingrid.hpp:66
We keep storage of terrain data abstract here since we need different implementations for game and ed...
Definition: storage.hpp:21
Grid mGrid
Definition: terraingrid.hpp:63
virtual void loadCell(int x, int y)
Definition: terraingrid.cpp:238
void updateTextureFiltering()
Definition: terraingrid.cpp:310
Reads shader template files and turns them into a concrete shader, based on a list of define's...
Definition: shadermanager.hpp:18
void updateCache()
Definition: terraingrid.cpp:285
osg::ref_ptr< SceneUtil::UnrefQueue > mUnrefQueue
Definition: terraingrid.hpp:70
OpenThreads::Mutex mTextureCacheMutex
Definition: terraingrid.hpp:60
Grid mGridCache
Definition: terraingrid.hpp:65
BufferCache mCache
Definition: terraingrid.hpp:68
~TerrainGrid()
Definition: terraingrid.cpp:64
TerrainGrid(osg::Group *parent, Resource::ResourceSystem *resourceSystem, osgUtil::IncrementalCompileOperation *ico, Storage *storage, int nodeMask, Shader::ShaderManager *shaderManager=NULL, SceneUtil::UnrefQueue *unrefQueue=NULL)
Definition: terraingrid.cpp:52
virtual void unloadCell(int x, int y)
Definition: terraingrid.cpp:270
Handles unreferencing of objects through the WorkQueue. Typical use scenario would be the main thread...
Definition: unrefqueue.hpp:19
TextureCache mTextureCache
Definition: terraingrid.hpp:59
std::map< std::pair< int, int >, osg::ref_ptr< osg::Node > > Grid
Definition: terraingrid.hpp:62
virtual osg::ref_ptr< osg::Node > cacheCell(int x, int y)
Definition: terraingrid.cpp:72