Changeset 99 for trunk/VUT/Ogre/src


Ignore:
Timestamp:
05/15/05 04:08:02 (20 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/Ogre/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp

    r96 r99  
    1212VisibilityOctreeSceneManager::VisibilityOctreeSceneManager( 
    1313        GtpVisibility::VisibilityManager *visManager) 
    14 : mVisibilityManager(visManager), mUseCulling(true) 
     14: mVisibilityManager(visManager), mUseVisibilityCulling(true) 
    1515{ 
    1616        mHierarchyInterface =  
     
    3838 
    3939        // standard scenemanager rendering without hierarchical culling 
    40         if(!mUseCulling) 
     40        if(!mUseVisibilityCulling) 
    4141        {        
    4242                OctreeSceneManager::_renderVisibleObjects(); 
     
    7676        SceneManager::_renderVisibleObjects(); 
    7777 
    78         // write out stats 
    79         WriteLog(); 
     78        //WriteLog(); // write out stats 
    8079} 
    8180//----------------------------------------------------------------------- 
    8281void VisibilityOctreeSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 
    8382{ 
    84         // empty if hierarchical culling is used => 
     83        // does nothing if hierarchical culling is used => 
    8584        // we interleave identification and rendering of objects  
    8685        // in _renderVisibibleObjects  
    87         if(!mUseCulling) 
     86        getRenderQueue()->clear(); 
     87    mBoxes.clear(); 
     88    mVisible.clear(); 
     89 
     90        if(!mUseVisibilityCulling) 
    8891        { 
    8992                OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 
     
    104107bool VisibilityOctreeSceneManager::setOption(const String & key, const void * val) 
    105108{ 
    106         if (key == "UseCulling") 
     109        if (key == "UseVisibilityCulling") 
    107110        { 
    108                 mUseCulling = (*static_cast<const bool *>(val)); 
     111                mUseVisibilityCulling = (*static_cast<const bool *>(val)); 
    109112                return true; 
    110113        } 
    111  
     114         
    112115        return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 
    113116                setOption(key, val) || OctreeSceneManager::setOption(key, val); 
  • trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp

    r96 r99  
    1212//----------------------------------------------------------------------- 
    1313VisibilitySceneManager::VisibilitySceneManager(GtpVisibility::VisibilityManager *visManager) 
    14 :mVisibilityManager(visManager), mUseCulling(true) 
     14:mVisibilityManager(visManager), mUseVisibilityCulling(true) 
    1515{ 
    1616        mHierarchyInterface = new SceneNodeHierarchyInterface(this, mDestRenderSystem); 
     
    2727        // we interleave identification and rendering of objects  
    2828        // in _renderVisibibleObjects  
    29         if(!mUseCulling) 
     29        if(!mUseVisibilityCulling) 
    3030        { 
    3131                SceneManager::_findVisibleObjects(cam, onlyShadowCasters); 
     
    3838        mVisibilityManager->GetCullingManager()->InitFrame(); 
    3939 
    40         if(!mUseCulling) 
     40        if(!mUseVisibilityCulling) 
    4141        {        
    4242                SceneManager::_renderVisibleObjects(); 
  • trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp

    r96 r99  
    1515VisibilityTerrainSceneManager::VisibilityTerrainSceneManager( 
    1616        GtpVisibility::VisibilityManager *visManager) 
    17 : mVisibilityManager(visManager), mUseCulling(true) 
     17: mVisibilityManager(visManager), mUseVisibilityCulling(true), 
     18mShowVisualization(false) 
    1819{ 
    1920        mHierarchyInterface =  
     
    3839         
    3940        // standard scenemanager rendering without hierarchical culling 
    40         if(!mUseCulling) 
     41        if(!mUseVisibilityCulling || mShowVisualization) 
    4142        {        
    4243                OctreeSceneManager::_renderVisibleObjects(); 
     
    7475        clearSpecialCaseRenderQueues(); 
    7576        SceneManager::_renderVisibleObjects(); 
     77 
     78        //WriteLog(); // write out stats 
    7679} 
    7780//----------------------------------------------------------------------- 
    7881void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 
    7982{ 
    80         // empty if hierarchical culling is used => 
     83        // does nothing if hierarchical culling is used => 
    8184        // we interleave identification and rendering of objects  
    8285        // in _renderVisibibleObjects  
    83         if(!mUseCulling) 
     86        if (mShowVisualization) 
     87    { 
     88                for ( BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it ) 
     89                { 
     90                        getRenderQueue()->addRenderable(*it); 
     91                } 
     92        } 
     93 
     94        getRenderQueue()->clear(); 
     95    mBoxes.clear(); 
     96    mVisible.clear(); 
     97 
     98        if(!mUseVisibilityCulling) 
    8499        { 
    85100                OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 
     
    101116bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val) 
    102117{ 
    103         if (key == "UseCulling") 
     118        if (key == "UseVisibilityCulling") 
    104119        { 
    105                 mUseCulling = (*static_cast<const bool *>(val)); 
     120                mUseVisibilityCulling = (*static_cast<const bool *>(val)); 
     121                return true; 
     122        } 
     123        if (key == "ShowVisualization") 
     124        { 
     125                mShowVisualization = (*static_cast<const bool *>(val)); 
    106126                return true; 
    107127        } 
     
    119139        } 
    120140         
     141 
    121142        return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 
    122143                getOption(key, val) && TerrainSceneManager::getOption(key, val); 
     
    144165} 
    145166//----------------------------------------------------------------------- 
     167void VisibilityTerrainSceneManager::SetShowVisualization(bool showViz) 
     168{ 
     169        mShowVisualization = showViz; 
     170} 
     171//----------------------------------------------------------------------- 
    146172void VisibilityTerrainSceneManager::WriteLog() 
    147173{ 
Note: See TracChangeset for help on using the changeset viewer.