Changeset 2108


Ignore:
Timestamp:
02/09/07 03:05:52 (17 years ago)
Author:
mattausch
Message:

loading geometry in scene manager

Location:
GTP/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp

    r2106 r2108  
    235235        // the scale factor for the visualized bounding boxes 
    236236        mSceneMgr->setOption("NodeVizScale", &mVizScale); 
    237                  
     237         
     238        ///////// 
    238239        //-- set the current culling algorithm type 
    239         setAlgorithm(mApplication->mAlgorithm); 
     240        //setAlgorithm(mApplication->mAlgorithm); 
     241 
     242        bool isNormalExecution; 
     243                 
     244        mSceneMgr->getOption("NormalExecution", &isNormalExecution); 
     245        if (isNormalExecution) 
     246        { 
     247                // no algorithm 
     248                mCurrentAlgorithm =  
     249                        GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS; 
     250        } 
     251        else 
     252        { 
     253                mSceneMgr->getOption("Algorithm", &mCurrentAlgorithm); 
     254        } 
     255         
     256        applyCurrentAlgorithm(); 
     257         
     258        /////////////////////////////// 
    240259 
    241260        // set scene manager options 
     
    481500                // frame start time 
    482501                mTimeFrameStarted = mTimer->getMilliseconds(); 
    483                 //Ogre::LogManager::getSingleton().logMessage("Frame started"); 
    484502        } 
    485503 
     
    517535                { 
    518536                        mApplication->Clamp2Terrain(mCamNode, 5); 
     537                        //Ogre::LogManager::getSingleton().logMessage("clamp to terrain"); 
    519538                } 
    520539                else 
    521540                { 
    522541                        mApplication->Clamp2FloorPlane(mFloorDist); 
     542                        //Ogre::LogManager::getSingleton().logMessage("clamp to floor"); 
    523543                } 
    524544 
     
    526546 
    527547        default: 
     548                Ogre::LogManager::getSingleton().logMessage("should not come here"); 
    528549                break; 
    529550        };       
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h

    r1607 r2108  
    7878                //-- write out stats for recorded walkthrough 
    7979                d << "Algorithm: " << algorithmName << "\n" 
    80                         << "avg. FPS: " << avgFps << "\n" 
    81                         << "best FPS: " << mBestFps << "\n" 
    82                         << "worst FPS: " << mWorstFps << "\n" 
    83                         << "#frames: " << mFrameCount << "\n" 
    84                         << "avg. #triangles: " << avgTris << " M\n" 
    85                         << "avg. #query culled nodes: " << avgFrustumCulledNodes << "\n" 
    86                         << "avg. #frustum culled nodes: " << avgQueryCulledNodes << "\n" 
    87                         << "avg. #rendered nodes: " << avgRenderedNodes << "\n"; 
     80                  << "avg. FPS: " << avgFps << "\n" 
     81                  << "best FPS: " << mBestFps << "\n" 
     82                  << "worst FPS: " << mWorstFps << "\n" 
     83                  << "#frames: " << mFrameCount << "\n" 
     84                  << "avg. #triangles: " << avgTris << " M\n" 
     85                  << "avg. #query culled nodes: " << avgFrustumCulledNodes << "\n" 
     86                  << "avg. #frustum culled nodes: " << avgQueryCulledNodes << "\n" 
     87                  << "avg. #rendered nodes: " << avgRenderedNodes << "\n"; 
    8888        } 
    8989 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r2106 r2108  
    217217        if (!val.empty()) 
    218218                mInitialPosition.z = atof( val.c_str()); 
    219  
    220219*/ 
     220 
    221221/*      val = config.getSetting("OnlineCullingAlgorithm"); 
    222222 
     
    457457        loadConfig("terrainCulling.cfg"); 
    458458         
    459         if (!LoadScene(mFilename)) 
     459        if (0 && !LoadScene(mFilename)) 
    460460                LogManager::getSingleton().logMessage("error loading scene"); 
    461461         
     
    499499        if (1)//||msShowHillyTerrain) 
    500500        { 
    501         mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain);  
    502                 std::string terrain_cfg("terrainCulling.cfg"); 
     501        std::string terrain_cfg("terrainCulling.cfg"); 
    503502                mSceneMgr->setWorldGeometry(terrain_cfg); 
    504503 
     504                mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain);  
    505505        } 
    506506         
     
    660660        } 
    661661#else 
    662         if (msShowHillyTerrain) 
    663         { 
    664                 mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager"); 
    665                 //mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 
    666                 //mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager"); 
    667         } 
    668         else 
    669         {        
    670                 mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager"); 
    671                 //mSceneMgr = mRoot->createSceneManager("OctreeSceneManager"); 
    672                 //mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager"); 
    673         } 
    674  
     662         
     663        mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager"); 
     664        //mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 
     665        //mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager"); 
     666         
    675667#endif 
    676668} 
     
    703695        RaySceneQueryResult::iterator rit = qryResult.begin(); 
    704696        bool success = false; 
    705 float yVal = 0; 
    706 float minVal = 999999999999; 
     697         
     698        float yVal = 0; 
     699        float minVal = 999999999999; 
    707700 
    708701        while (rit != qryResult.end() && rit->movable) 
     
    779772                        { 
    780773                                // terrain hack 
    781                                 msShowHillyTerrain = true; 
     774                                //msShowHillyTerrain = true; 
    782775                                LogManager::getSingleton().logMessage("error loading scene => load terrain"); 
    783776                        } 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r2102 r2108  
    216216                        LogManager::getSingleton().logMessage("loading terrain"); 
    217217                } 
     218                else 
     219                { 
     220                        mShowTerrain = false; 
     221                        LogManager::getSingleton().logMessage("loading geometry"); 
     222                } 
    218223        } 
    219224 
     
    356361                        "TerrainSceneManager::loadConfig"); 
    357362        } 
     363 
    358364        TerrainPageSourceOptionList optlist; 
    359365        ConfigFile::SettingsIterator setIt = config.getSettingsIterator(); 
     
    367373                } 
    368374        } 
     375 
    369376        // set the page source 
    370377        selectPageSource(pageSourceName, optlist); 
     
    394401        } 
    395402 
    396         // set old view cell geometry to invisible 
     403        // show current view cell geometry 
    397404    if (mCurrentViewCell && mCurrentViewCell->GetMesh()) 
    398405        { 
     
    906913                mElementaryViewCell = NULL; 
    907914 
    908                 // with view cells all objects are set to invisible per default 
     915                // all objects are set to invisible per default 
    909916                SetObjectsVisible(!mUseViewCells); 
    910917 
     
    936943                return true; 
    937944        } 
     945        if (key == "ShowTerrain") 
     946        {  
     947                mShowTerrain = *static_cast<const bool *>(val); 
     948                return true; 
     949        } 
    938950        if (key == "UseVisibilityFilter") 
    939951        { 
     
    942954                // set null => recomputation of the pvs 
    943955        mElementaryViewCell = NULL; 
     956 
    944957                return true; 
    945958        } 
     
    982995                return true; 
    983996        } 
    984         if (key == "AlgorithmType") 
     997        if (key == "NormalExecution") 
     998        { 
     999                * static_cast<bool *>(val) = (bool *)mNormalExecution; 
     1000                return true; 
     1001        } 
     1002        if (key == "Algorithm") 
    9851003        { 
    9861004                GtpVisibility::VisibilityEnvironment::CullingManagerType algorithm = 
     
    16831701{ 
    16841702        using namespace std; 
     1703 
    16851704        // use leaf nodes of the original spatial hierarchy as occludees 
    16861705        vector<string> filenames; 
    16871706        const int files = SplitFilenames(filename, filenames); 
    16881707         
    1689         std::stringstream d; 
     1708        stringstream d; 
    16901709        d << "number of input files: " << files << "\n"; 
    16911710        LogManager::getSingleton().logMessage(d.str()); 
     
    17021721                return false; 
    17031722        } 
    1704 /* 
     1723 
    17051724        for (fit = filenames.begin(); fit != fit_end; ++ fit, ++ i) 
    17061725        { 
     
    17201739                result = true; 
    17211740        } 
    1722 */      result=true; 
     1741 
    17231742        return result; 
    17241743} 
Note: See TracChangeset for help on using the changeset viewer.