source: trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h @ 130

Revision 130, 3.4 KB checked in by mattausch, 19 years ago (diff)

added visibility queries

Line 
1#ifndef _VisibilityTerrainSceneManager_H__
2#define _VisibilityTerrainSceneManager_H__
3
4#include <OgreSceneNode.h>
5#include <OgreTerrainSceneManager.h>
6#include <OgreOctreeNode.h>
7#include <OgreOctreeCamera.h>
8#include <OgrePrerequisites.h>
9
10#include "OgreOctreeHierarchyInterface.h"
11#include "OgrePlatformQueryManager.h"
12#include "VisibilityManager.h"
13
14namespace Ogre {
15
16/**
17        This class extends the terrain scene manager,
18        using occlusion queries for visibility culling.
19*/
20class __declspec(dllexport) VisibilityTerrainSceneManager: public TerrainSceneManager
21{
22public:
23        VisibilityTerrainSceneManager(GtpVisibility::VisibilityManager *visManager);
24        ~VisibilityTerrainSceneManager();
25
26        void _renderVisibleObjects();
27        void _findVisibleObjects(Camera* cam, bool onlyShadowCasters);
28        void _updateSceneGraph(Camera* cam);
29
30        /** Sets the given option for the SceneManager
31                @remarks Options are: "Algorithm", int *;                       
32        */
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();
51
52        /** Render a set of objects, see renderSingleObject for param definitions
53                Override so we can handle delayed rendering of transparent objects
54        */
55        virtual void renderObjects(const RenderPriorityGroup::TransparentRenderablePassList& objs,
56            bool doLightIteration, const LightList* manualLightList = 0);
57
58        /** Writes out stats into the Ogre log file.
59        */
60        void WriteLog();
61
62        /** Override pass so we can do the z-fail pass.
63        */
64        Pass* setPass(Pass* pass);
65
66        /** Override from SceneManager so we can skip all but first pass for depth pass.
67        */
68        bool validatePassForRendering(Pass* pass);
69
70        void RenderItemBuffer(RenderPriorityGroup* pGroup);
71        void RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass);
72        void renderQueueGroupObjects(RenderQueueGroup* pGroup);
73
74        /** Override from SceneManager so that sub entities can be assigned an id for item buffer */
75        Entity* createEntity(const String& entityName, const String& meshName);
76
77        /** Returns pointer to visibility manager */
78        GtpVisibility::VisibilityManager *GetVisibilityManager();
79
80protected:
81       
82        /** Creates material for depth pass, e.g., a pass that only fills the depth buffer. */
83        void InitDepthPass();
84        /** Creates material for item buffer. */
85        void InitItemBufferPass();
86        /** Fills render queue so that a visualization can be rendered. */
87        void ShowVisualization(Camera *cam);
88
89        OctreeHierarchyInterface *mHierarchyInterface;
90        GtpVisibility::VisibilityManager *mVisibilityManager;
91
92        bool mShowVisualization;
93        bool mSkipTransparents;
94        bool mVisualizeCulledNodes;
95
96        bool mRenderNodesForViz;
97        bool mRenderNodesContentForViz;
98        bool mDelayRenderTransparents;
99        bool mUseDepthPass;
100        bool mRenderDepthPass;
101        bool mRenderItemBuffer;
102
103        Pass *mDepthPass;
104        Pass *mItemBufferPass;
105
106        int mCurrentEntityId;
107
108        PlatformQueryManager *mQueryManager;
109};
110
111} // namespace Ogre
112
113#endif // CullingTerrainSceneManager_H
Note: See TracBrowser for help on using the repository browser.