1 | #ifndef _VisibilityOctreeSceneManager_H__
|
---|
2 | #define _VisibilityOctreeSceneManager_H__
|
---|
3 |
|
---|
4 | #include <OgreSceneNode.h>
|
---|
5 | #include <OgreOctreeSceneManager.h>
|
---|
6 | #include <OgreOctreeNode.h>
|
---|
7 | #include <OgreOctreeCamera.h>
|
---|
8 | #include <OgrePrerequisites.h>
|
---|
9 |
|
---|
10 | #include "OgreOctreeHierarchyInterface.h"
|
---|
11 | #include "VisibilityManager.h"
|
---|
12 |
|
---|
13 | namespace Ogre {
|
---|
14 |
|
---|
15 | /**
|
---|
16 | This class extends the octree scene manager, using
|
---|
17 | occlusion queries for visibility culling.
|
---|
18 | */
|
---|
19 | class VisibilityOctreeSceneManager: public OctreeSceneManager
|
---|
20 | {
|
---|
21 | public:
|
---|
22 | VisibilityOctreeSceneManager(GtpVisibility::VisibilityManager *visManager);
|
---|
23 | ~VisibilityOctreeSceneManager();
|
---|
24 |
|
---|
25 | void _renderVisibleObjects();
|
---|
26 | void _findVisibleObjects(Camera* cam, bool onlyShadowCasters);
|
---|
27 | void _updateSceneGraph(Camera* cam );
|
---|
28 |
|
---|
29 | /** Sets the given option for the SceneManager
|
---|
30 | @remarks
|
---|
31 | Options are:
|
---|
32 | "Algorithm", int *;
|
---|
33 | */
|
---|
34 | virtual bool setOption(const String &, const void *);
|
---|
35 | /** Gets the given option for the Scene VisibilityManager.
|
---|
36 | @remarks
|
---|
37 | See setOption
|
---|
38 | */
|
---|
39 | virtual bool getOption(const String &, void *);
|
---|
40 |
|
---|
41 | bool getOptionValues(const String & key, StringVector &refValueList);
|
---|
42 | bool getOptionKeys(StringVector &refKeys);
|
---|
43 |
|
---|
44 | /** Sets the visibility manager.
|
---|
45 | @param visManager the visibility manager
|
---|
46 | */
|
---|
47 | void setVisibilityManager(GtpVisibility::VisibilityManager *visManager);
|
---|
48 | /** See set.
|
---|
49 | */
|
---|
50 | GtpVisibility::VisibilityManager *getVisibilityManager( void );
|
---|
51 |
|
---|
52 | /** Writes out stats into the Ogre log file.
|
---|
53 | */
|
---|
54 | void WriteLog();
|
---|
55 |
|
---|
56 | /** Render a set of objects, see renderSingleObject for param definitions
|
---|
57 | Override so we can handle delayed rendering of transparent objects
|
---|
58 | */
|
---|
59 | virtual void renderObjects(const RenderPriorityGroup::TransparentRenderablePassList& objs,
|
---|
60 | bool doLightIteration, const LightList* manualLightList = 0);
|
---|
61 | protected:
|
---|
62 |
|
---|
63 | void CreateDepthPass();
|
---|
64 |
|
---|
65 | OctreeHierarchyInterface *mHierarchyInterface;
|
---|
66 | GtpVisibility::VisibilityManager *mVisibilityManager;
|
---|
67 |
|
---|
68 | bool mShowVisualization;
|
---|
69 | bool mSkipTransparents;
|
---|
70 | bool mVisualizeCulledNodes;
|
---|
71 |
|
---|
72 | bool mRenderNodesForViz;
|
---|
73 | bool mRenderNodesContentForViz;
|
---|
74 | bool mDelayRenderTransparents;
|
---|
75 | bool mUseDepthPass;
|
---|
76 |
|
---|
77 | Pass *mDepthPass;
|
---|
78 | };
|
---|
79 |
|
---|
80 | } // namespace Ogre
|
---|
81 |
|
---|
82 | #endif // VisibilityOctreeSceneManager_H |
---|