1 | #ifndef _OcclusionCullingTerrainSceneManager_H__
|
---|
2 | #define _OcclusionCullingTerrainSceneManager_H__
|
---|
3 |
|
---|
4 | #include <OgreSceneNode.h>
|
---|
5 | #include <OgreOctreeSceneManager.h>
|
---|
6 | #include <OgreTerrainSceneManager.h>
|
---|
7 | #include <OgreOctreeSceneQuery.h>
|
---|
8 | #include <OgreOctreeNode.h>
|
---|
9 | #include <OgreOctreeCamera.h>
|
---|
10 |
|
---|
11 | #include "OgrePrerequisites.h"
|
---|
12 | #include "OgreOcclusionCullingTerrainSceneTraverser.h"
|
---|
13 | //#include "OgreSolidHalfBoundingBox.h"
|
---|
14 |
|
---|
15 | using namespace std; |
---|
16 | |
---|
17 | namespace Ogre { |
---|
18 | /**
|
---|
19 | Class which implements a scene mangager which uses occlusion queries for culling occluded objects
|
---|
20 | */
|
---|
21 | class OcclusionCullingTerrainSceneManager: public TerrainSceneManager
|
---|
22 | {
|
---|
23 | public:
|
---|
24 | OcclusionCullingTerrainSceneManager();
|
---|
25 | ~OcclusionCullingTerrainSceneManager();
|
---|
26 |
|
---|
27 | void _renderVisibleObjects(void);
|
---|
28 | void _findVisibleObjects(Camera* cam, bool onlyShadowCasters);
|
---|
29 | void _updateSceneGraph(Camera* cam);
|
---|
30 |
|
---|
31 | /** Sets the given option for the SceneManager
|
---|
32 | @remarks
|
---|
33 | Options are:
|
---|
34 | "Algorithm", int *;
|
---|
35 | */
|
---|
36 |
|
---|
37 | virtual bool setOption( const String &, const void * );
|
---|
38 | /** Gets the given option for the Scene Manager.
|
---|
39 | @remarks
|
---|
40 | See setOption
|
---|
41 | */
|
---|
42 | virtual bool getOption( const String &, void * );
|
---|
43 |
|
---|
44 | bool getOptionValues( const String & key, StringVector &refValueList );
|
---|
45 | bool getOptionKeys( StringVector &refKeys );
|
---|
46 |
|
---|
47 | /** Renders one octant of an octree, i.e., renders current octant
|
---|
48 | node and does not traverse deeper into the tree.
|
---|
49 | @remark Note that OctreeNode instances are NOT part of the octree
|
---|
50 | hierarchy, instead one octant of an Octree contains many OctreeNode instances.
|
---|
51 | @param octree the octree to be rendered
|
---|
52 | @param cam current camera
|
---|
53 | */
|
---|
54 | void _renderOctant(Camera* cam, Octree *octree);
|
---|
55 |
|
---|
56 | protected:
|
---|
57 | /** Recursively counts octree size (i.e., number of octree instances)
|
---|
58 | @param root current octree
|
---|
59 | */
|
---|
60 | //unsigned int countOctreeSize(Octree *root);
|
---|
61 |
|
---|
62 | OcclusionCullingTerrainSceneTraverser *mOcclusionCullingTerrainSceneTraverser;
|
---|
63 | };
|
---|
64 |
|
---|
65 | }
|
---|
66 | #endif // OcclusionCullingTerrainSceneManager_H |
---|