source: trunk/VUT/Ogre/src/OgreVisibilityDotSceneManager.cpp @ 59

Revision 59, 3.9 KB checked in by mattausch, 20 years ago (diff)

completely changed file structure plus software design

RevLine 
[59]1#include <OgreVisibilityDotSceneManager.h>
2#include <OgreMath.h>
3#include <OgreIteratorWrappers.h>
4#include <OgreRenderSystem.h>
5#include <OgreCamera.h>
6
7//#include <windows.h>
8
9namespace Ogre {
10
11//-----------------------------------------------------------------------
12VisibilityDotSceneManager::VisibilityDotSceneManager(GtpVisibility::VisibilityManager *visManager)
13:mVisibilityManager(visManager)
14{
15        mHierarchyInterface =
16                new SceneNodeHierarchyInterface(this, mDestRenderSystem);
17       
18        mShowBoundingBoxes = true;
19       
20        //mDisplayNodes = true;
21        //mShowBoxes = true;
22}
23//-----------------------------------------------------------------------
24VisibilityDotSceneManager::~VisibilityDotSceneManager()
25{
26        delete mHierarchyInterface;
27}
28//-----------------------------------------------------------------------
29void VisibilityDotSceneManager::_renderVisibleObjects(void)
30{
31        //-- render background
32        clearSpecialCaseRenderQueues();
33        addSpecialCaseRenderQueue(RENDER_QUEUE_BACKGROUND);
34        addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_EARLY);
35
36        setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);
37        DotSceneManager::_renderVisibleObjects();
38#ifdef GTP_VISIBILITY_MODIFIED_OGRE
39        _deleteRenderedQueueGroups();
40#endif
41        //-- render visible objects (i.e., all but overlay)
42        clearSpecialCaseRenderQueues();
43        addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);
44        setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);
45
46        mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress);
47
48        mVisibilityManager->ApplyVisibilityCulling();
49
50#ifdef GTP_VISIBILITY_MODIFIED_OGRE
51        _deleteRenderedQueueGroups();
52#endif
53
54        //-- render overlay
55        clearSpecialCaseRenderQueues();
56        DotSceneManager::_renderVisibleObjects( );
57
58        clearSpecialCaseRenderQueues();
59}
60//-----------------------------------------------------------------------
61void VisibilityDotSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters)
62{
63        // must be empty because objects are found and rendered in an interleaved fashion
64        // in _renderVisibibleObjects
65}
66//-----------------------------------------------------------------------
67void VisibilityDotSceneManager::_updateSceneGraph(Camera* cam)
68{
69        //mVisibilitySceneTraverser->setNumSceneNodes((int)mSceneNodes.size());
70        mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface);
71        mHierarchyInterface->SetRenderSystem(mDestRenderSystem);
72                               
73        DotSceneManager::_updateSceneGraph(cam);
74}
75//-----------------------------------------------------------------------
76bool VisibilityDotSceneManager::setOption(const String & key, const void * val)
77{
78        return /*mVisibilitySceneTraverser->setOption( key, val) || */DotSceneManager::setOption(key, val);
79}
80//-----------------------------------------------------------------------
81bool VisibilityDotSceneManager::getOption(const String & key, void *val)
82{
83        return /*mVisibilitySceneTraverser->getOption( key, val) || */DotSceneManager::getOption(key, val);
84}
85//-----------------------------------------------------------------------
86bool VisibilityDotSceneManager::getOptionValues(const String & key, StringVector  &refValueList)
87{
88        return DotSceneManager::getOptionValues(key, refValueList);
89}
90//-----------------------------------------------------------------------
91bool VisibilityDotSceneManager::getOptionKeys(StringVector & refKeys)
92{
93        return /*mVisibilitySceneTraverser->getOptionKeys ( refKeys ) || */DotSceneManager::getOptionKeys( refKeys );
94}
95//-----------------------------------------------------------------------
96void VisibilityDotSceneManager::setVisibilityManager(GtpVisibility::VisibilityManager *visManager)
97{
98        mVisibilityManager = visManager;
99}
100//-----------------------------------------------------------------------
101GtpVisibility::VisibilityManager *VisibilityDotSceneManager::getVisibilityManager()
102{
103        return mVisibilityManager;
104}
105
106//} // namespace GtpVisibility
107} // namespace Ogre
Note: See TracBrowser for help on using the repository browser.