OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
quadtreeworld.hpp
Go to the documentation of this file.
1 #ifndef COMPONENTS_TERRAIN_QUADTREEWORLD_H
2 #define COMPONENTS_TERRAIN_QUADTREEWORLD_H
3 
4 #include "world.hpp"
5 
6 #include <OpenThreads/Mutex>
7 
8 namespace osg
9 {
10  class NodeVisitor;
11 }
12 
13 namespace Terrain
14 {
15  class RootNode;
16  class ViewDataMap;
17 
20  {
21  public:
22  QuadTreeWorld(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int nodeMask, int preCompileMask=~0, int borderMask=0);
24 
25  void accept(osg::NodeVisitor& nv);
26 
27  virtual void enable(bool enabled);
28 
29  void cacheCell(View *view, int x, int y);
30 
31  View* createView();
32  void preload(View* view, const osg::Vec3f& eyePoint);
33 
34  void reportStats(unsigned int frameNumber, osg::Stats* stats);
35 
36  virtual void setDefaultViewer(osg::Object* obj);
37 
38  private:
39  void ensureQuadTreeBuilt();
40 
41  osg::ref_ptr<RootNode> mRootNode;
42 
43  osg::ref_ptr<ViewDataMap> mViewDataMap;
44 
45  OpenThreads::Mutex mQuadTreeMutex;
47  };
48 
49 }
50 
51 #endif
Wrapper class that constructs and provides access to the most commonly used resource subsystems...
Definition: resourcesystem.hpp:30
QuadTreeWorld(osg::Group *parent, osg::Group *compileRoot, Resource::ResourceSystem *resourceSystem, Storage *storage, int nodeMask, int preCompileMask=~0, int borderMask=0)
Definition: quadtreeworld.cpp:227
The basic interface for a terrain world. How the terrain chunks are paged and displayed is up to the ...
Definition: world.hpp:52
View * createView()
Definition: quadtreeworld.cpp:423
void ensureQuadTreeBuilt()
Definition: quadtreeworld.cpp:381
Terrain implementation that loads cells into a Quad Tree, with geometry LOD and texture LOD...
Definition: quadtreeworld.hpp:19
osg::ref_ptr< RootNode > mRootNode
Definition: quadtreeworld.hpp:41
bool mQuadTreeBuilt
Definition: quadtreeworld.hpp:46
void reportStats(unsigned int frameNumber, osg::Stats *stats)
Definition: quadtreeworld.cpp:442
void preload(View *view, const osg::Vec3f &eyePoint)
Definition: quadtreeworld.cpp:428
void accept(osg::NodeVisitor &nv)
Definition: quadtreeworld.cpp:332
Definition: storage.hpp:22
OpenThreads::Mutex mQuadTreeMutex
Definition: quadtreeworld.hpp:45
A View is a collection of rendering objects that are visible from a given camera/intersection. The base View class is part of the interface for usage in conjunction with preload feature.
Definition: world.hpp:39
osg::ref_ptr< ViewDataMap > mViewDataMap
Definition: quadtreeworld.hpp:43
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...
Definition: quadtreeworld.cpp:447
~QuadTreeWorld()
Definition: quadtreeworld.cpp:236
virtual void enable(bool enabled)
Definition: quadtreeworld.cpp:396
void cacheCell(View *view, int x, int y)
Definition: quadtreeworld.cpp:410