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

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

completely changed file structure plus software design

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