[59] | 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
|
---|
[118] | 30 | @remarks Options are: "Algorithm", int *;
|
---|
[59] | 31 | */
|
---|
[118] | 32 |
|
---|
[59] | 33 | virtual bool setOption(const String &, const void *);
|
---|
| 34 | /** Gets the given option for the Scene VisibilityManager.
|
---|
| 35 | @remarks
|
---|
| 36 | See setOption
|
---|
| 37 | */
|
---|
| 38 | virtual bool getOption(const String &, void *);
|
---|
| 39 |
|
---|
| 40 | bool getOptionValues(const String & key, StringVector &refValueList);
|
---|
| 41 | bool getOptionKeys(StringVector &refKeys);
|
---|
| 42 |
|
---|
| 43 | /** Sets the visibility manager.
|
---|
| 44 | @param visManager the visibility manager
|
---|
| 45 | */
|
---|
| 46 | void setVisibilityManager(GtpVisibility::VisibilityManager *visManager);
|
---|
| 47 | /** See set.
|
---|
| 48 | */
|
---|
[118] | 49 | GtpVisibility::VisibilityManager *getVisibilityManager();
|
---|
[115] | 50 |
|
---|
[114] | 51 | /** Render a set of objects, see renderSingleObject for param definitions
|
---|
| 52 | Override so we can handle delayed rendering of transparent objects
|
---|
| 53 | */
|
---|
| 54 | virtual void renderObjects(const RenderPriorityGroup::TransparentRenderablePassList& objs,
|
---|
| 55 | bool doLightIteration, const LightList* manualLightList = 0);
|
---|
[118] | 56 |
|
---|
| 57 | /** Writes out stats into the Ogre log file.
|
---|
| 58 | */
|
---|
| 59 | void WriteLog();
|
---|
| 60 |
|
---|
| 61 | /** Override pass so we can do the z-fail pass */
|
---|
| 62 | Pass* setPass(Pass* pass);
|
---|
| 63 |
|
---|
[59] | 64 | protected:
|
---|
[118] | 65 | /** Creates material for depth pass, e.g., a pass that only fills the depth buffer */
|
---|
[119] | 66 | void InitDepthPass();
|
---|
[130] | 67 |
|
---|
| 68 | /** Prepares visualization of hierarchical culling. */
|
---|
[139] | 69 | void PrepareVisualization(Camera *cam);
|
---|
[59] | 70 | OctreeHierarchyInterface *mHierarchyInterface;
|
---|
| 71 | GtpVisibility::VisibilityManager *mVisibilityManager;
|
---|
[100] | 72 |
|
---|
| 73 | bool mShowVisualization;
|
---|
[115] | 74 | bool mSkipTransparents;
|
---|
[112] | 75 | bool mVisualizeCulledNodes;
|
---|
[113] | 76 |
|
---|
[114] | 77 | bool mRenderNodesForViz;
|
---|
| 78 | bool mRenderNodesContentForViz;
|
---|
[115] | 79 | bool mDelayRenderTransparents;
|
---|
| 80 | bool mUseDepthPass;
|
---|
[122] | 81 | bool mRenderDepthPass;
|
---|
[115] | 82 |
|
---|
| 83 | Pass *mDepthPass;
|
---|
[59] | 84 | };
|
---|
| 85 |
|
---|
| 86 | } // namespace Ogre
|
---|
| 87 |
|
---|
| 88 | #endif // VisibilityOctreeSceneManager_H |
---|