Changeset 945


Ignore:
Timestamp:
05/10/06 18:33:48 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE
Files:
3 edited

Legend:

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

    r937 r945  
    217217        } 
    218218 
     219        // loading overlay 
     220 
     221        mLoadingOverlay = OverlayManager::getSingleton().getByName("Example/Visibility/LoadingOverlay"); 
     222        mMyLoadingInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/Loading/MyLoadingInfo"); 
     223        mMyLoadingInfo->setCaption("loading view cells ..."); 
     224         
     225        /*const int top = 10; 
     226                mMyStatsAlgorithmInfo->setTop(top); 
     227 
     228                char str[100]; sprintf(str,": %d", 0); 
     229                mMyStatsFpsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/MyFpsInfo"); 
     230                mMyStatsFpsInfo->setCaption(str);*/ 
     231 
     232        mLoadingOverlay->hide(); 
     233 
    219234        // note: larger magnification for terrain to show single objects 
    220235        if (TestCullingTerrainApplication::msShowHillyTerrain) 
     
    9901005        mAlgorithmInfo->setCaption(": " + msAlgorithmCaptions[mCurrentAlgorithm]); 
    9911006        mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm); 
    992         std::stringstream d; d << "algorithm: " << msAlgorithmCaptions[mCurrentAlgorithm]; 
    993         if (1) Ogre::LogManager::getSingleton().logMessage(d.str()); 
     1007 
     1008        if (1) 
     1009        { 
     1010                std::stringstream d; d << "algorithm: " << msAlgorithmCaptions[mCurrentAlgorithm]; 
     1011                Ogre::LogManager::getSingleton().logMessage(d.str()); 
     1012        } 
    9941013} 
    9951014//----------------------------------------------------------------------- 
     
    11731192        if (mUseViewCells && !mViewCellsLoaded) 
    11741193        { 
     1194                mLoadingOverlay->show(); 
     1195 
     1196                // call once to load view cell loading overlay 
     1197                mWindow->update(); 
     1198 
    11751199                mViewCellsLoaded = mApplication->LoadViewCells(mApplication->mViewCellsFilename); 
    1176         } 
     1200                 
     1201                mLoadingOverlay->hide(); 
     1202        } 
     1203 
     1204        if (mUseViewCells) 
     1205                mViewCellsInfo->setCaption(": on"); 
     1206        else 
     1207                mViewCellsInfo->setCaption(": off"); 
    11771208 
    11781209        mSceneMgr->setOption("UseViewCells", &mUseViewCells); 
     
    13641395         
    13651396        case KC_F7: 
    1366                 setObjectType(++mCurrentObjectType); 
     1397                setObjectType(++ mCurrentObjectType); 
    13671398                break; 
    13681399        case KC_F8: 
     
    13831414                break; 
    13841415        case KC_8: 
    1385         //      changeAssumedVisibility(-5); 
    1386                 changeAssumedVisibility(-500); 
     1416                changeAssumedVisibility(-5); 
     1417        //      changeAssumedVisibility(-500); 
    13871418                break; 
    13881419        case KC_9: 
    1389                 changeAssumedVisibility(500); 
    1390                 //changeAssumedVisibility(5); 
     1420        //      changeAssumedVisibility(500); 
     1421                changeAssumedVisibility(5); 
    13911422                break; 
    13921423        case KC_LSHIFT: 
     
    17711802        initOverlayElement(&mAssumedVisibilityInfo, ext, "AssumedVisibility", top, ": 0"); top += vert_space; 
    17721803        initOverlayElement(&mCurrentObjectTypeInfo, ext, "CurrentObjectType", top, ": "); top += vert_space; 
     1804        initOverlayElement(&mViewCellsInfo, ext, "ViewCells", top, ": "); top += vert_space; 
    17731805        //initOverlayElement(&mHelpInfo, ext, "Help", top, ": "); top += vert_space; 
    17741806 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h

    r937 r945  
    327327        OverlayElement *mDelayedTraversedNodesInfo; 
    328328        OverlayElement *mCurrentObjectTypeInfo; 
     329        OverlayElement *mViewCellsInfo; 
    329330 
    330331        OverlayElement *mMyStatsAlgorithmInfo; 
    331332        OverlayElement *mMyStatsFpsInfo; 
    332333 
     334        OverlayElement *mMyLoadingInfo; 
     335         
    333336        OverlayElement *mQueryTypeInfo; 
    334337        OverlayElement *mQueryVisibleNodesInfo; 
     
    402405        Overlay* mQueryOverlay; 
    403406        Overlay* mMyStatsOverlay; 
     407        Overlay *mLoadingOverlay; 
    404408 
    405409        Light *mSunLight; 
     
    417421 
    418422        int mCurrentObjectType; 
    419  
     423         
    420424        bool mDeleteObjects; 
    421425        bool mRecordVideo; 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r937 r945  
    149149 
    150150 
    151 /**************************************************************/ 
    152 /*        TestCullingTerrainApplication implementation        */ 
    153 /**************************************************************/ 
     151/********************************************************************/ 
     152/*            TestCullingTerrainApplication implementation          */ 
     153/********************************************************************/ 
    154154 
    155155 
     
    159159mIVReader(NULL), 
    160160mFilename("terrain"), 
    161 mEnvironmentFilename("simple.env") 
     161mEnvironmentFilename("generate_viewcells.env") 
    162162{ 
    163163} 
     
    335335        mIVReader = new IVReader(); 
    336336 
     337        Timer *timer = PlatformManager::getSingleton().createTimer(); 
     338        timer->reset(); 
    337339        if (1) 
    338340        { 
     
    350352 
    351353                mIVReader->buildTree(mSceneMgr, node); 
     354                 
     355                mIVReader->collapse(); 
    352356                OGRE_DELETE(mIVReader); 
     357 
     358 
     359                std::stringstream d;  
     360                d << "loaded " << filename << " in " << timer->getMilliseconds() * 1e-3 << " secs"; 
     361                LogManager::getSingleton().logMessage(d.str()); 
     362                 
     363                PlatformManager::getSingleton().destroyTimer(timer); 
     364 
     365                //-- bake into static geometry 
     366                if (USE_STATIC_GEOMETRY) 
     367                { 
     368                        BakeSceneIntoStaticGeometry("staticVienna", "Vienna"); 
     369                } 
     370         
    353371                return true; 
    354372        } 
    355373 
    356         mIVReader->collapse(); 
    357  
    358         //-- bake into static geometry 
    359         if (USE_STATIC_GEOMETRY) 
    360         { 
    361                 BakeSceneIntoStaticGeometry("staticVienna", "Vienna"); 
    362         } 
    363          
    364         OGRE_DELETE(mIVReader); 
    365374 
    366375        return false; 
     
    391400        //roofsNode->detachAllObjects(); 
    392401        //roadsNode->detachAllObjects(); 
    393         //      planeNode->detachAllObjects(); 
     402        //planeNode->detachAllObjects(); 
    394403         
    395404        //viennaNode->removeChild("Walls"); 
     
    470479 
    471480        mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5)); 
    472     
    473481 
    474482        //-- terrain content setup 
     
    485493 
    486494        mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 
    487          
    488          
     495                 
     496        if (!msShowHillyTerrain) 
     497                return; 
     498 
    489499        // if no objects in file, we generate new objects 
    490         if (msShowHillyTerrain && !mTerrainContentGenerator->LoadObjects("objects.out")) 
     500        if (!mTerrainContentGenerator->LoadObjects("objects.out")) 
    491501        { 
    492502                // the objects are generated randomly distributed over the terrain 
Note: See TracChangeset for help on using the changeset viewer.