Changeset 87 for trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
- Timestamp:
- 05/09/05 01:24:02 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r86 r87 7 7 #include <OgreCamera.h> 8 8 9 //#include <windows.h>9 #include <windows.h> 10 10 11 11 namespace Ogre { 12 //namespace GtpVisibility { 12 13 13 //----------------------------------------------------------------------- 14 14 VisibilityTerrainSceneManager::VisibilityTerrainSceneManager( 15 GtpVisibility::VisibilityManager *visManager): mVisibilityManager(visManager) 15 GtpVisibility::VisibilityManager *visManager) 16 : mVisibilityManager(visManager), mUseCulling(true) 16 17 { 17 18 mHierarchyInterface = 18 19 new OctreeHierarchyInterface(this, mDestRenderSystem); 19 20 20 //mShowBoxes = true;21 21 //mDisplayNodes = true; 22 22 //mShowBoundingBoxes = true; … … 31 31 void VisibilityTerrainSceneManager::_renderVisibleObjects() 32 32 { 33 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress); 34 mVisibilityManager->GetCullingManager()->InitFrame(); 35 36 if(!mUseCulling) 37 { 38 OctreeSceneManager::_renderVisibleObjects(); 39 return; 40 } 41 42 //-- hierarchical culling 43 // the objects of different layers (e.g., background, scene, 44 // overlay) must be identified and rendered one after another 45 33 46 //-- render background 34 47 clearSpecialCaseRenderQueues(); … … 47 60 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 48 61 49 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress);62 //-- the hierarchical culling algorithm 50 63 mVisibilityManager->ApplyVisibilityCulling(); 51 64 … … 56 69 //-- render overlay 57 70 clearSpecialCaseRenderQueues(); 58 SceneManager::_renderVisibleObjects( 71 SceneManager::_renderVisibleObjects(); 59 72 } 60 73 //----------------------------------------------------------------------- 61 74 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 62 75 { 63 // must be empty because objects are found and rendered in an interleaved fashion 76 // empty if hierarchical culling is used => 77 // we interleave identification and rendering of objects 64 78 // in _renderVisibibleObjects 79 if(!mUseCulling) 80 { 81 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 82 } 65 83 } 66 84 //----------------------------------------------------------------------- … … 79 97 bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val) 80 98 { 99 if (key == "UseCulling") 100 { 101 mUseCulling = (*static_cast<const bool *>(val)); 102 return true; 103 } 104 81 105 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 82 106 setOption(key, val) || TerrainSceneManager::setOption(key, val); … … 115 139 return mVisibilityManager; 116 140 } 117 //} // namespace GtpVisibility118 141 } // namespace Ogre
Note: See TracChangeset
for help on using the changeset viewer.