Changeset 945 for GTP/trunk/App
- Timestamp:
- 05/10/06 18:33:48 (19 years ago)
- 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 217 217 } 218 218 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 219 234 // note: larger magnification for terrain to show single objects 220 235 if (TestCullingTerrainApplication::msShowHillyTerrain) … … 990 1005 mAlgorithmInfo->setCaption(": " + msAlgorithmCaptions[mCurrentAlgorithm]); 991 1006 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 } 994 1013 } 995 1014 //----------------------------------------------------------------------- … … 1173 1192 if (mUseViewCells && !mViewCellsLoaded) 1174 1193 { 1194 mLoadingOverlay->show(); 1195 1196 // call once to load view cell loading overlay 1197 mWindow->update(); 1198 1175 1199 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"); 1177 1208 1178 1209 mSceneMgr->setOption("UseViewCells", &mUseViewCells); … … 1364 1395 1365 1396 case KC_F7: 1366 setObjectType(++ mCurrentObjectType);1397 setObjectType(++ mCurrentObjectType); 1367 1398 break; 1368 1399 case KC_F8: … … 1383 1414 break; 1384 1415 case KC_8: 1385 //changeAssumedVisibility(-5);1386 changeAssumedVisibility(-500);1416 changeAssumedVisibility(-5); 1417 // changeAssumedVisibility(-500); 1387 1418 break; 1388 1419 case KC_9: 1389 changeAssumedVisibility(500);1390 //changeAssumedVisibility(5);1420 // changeAssumedVisibility(500); 1421 changeAssumedVisibility(5); 1391 1422 break; 1392 1423 case KC_LSHIFT: … … 1771 1802 initOverlayElement(&mAssumedVisibilityInfo, ext, "AssumedVisibility", top, ": 0"); top += vert_space; 1772 1803 initOverlayElement(&mCurrentObjectTypeInfo, ext, "CurrentObjectType", top, ": "); top += vert_space; 1804 initOverlayElement(&mViewCellsInfo, ext, "ViewCells", top, ": "); top += vert_space; 1773 1805 //initOverlayElement(&mHelpInfo, ext, "Help", top, ": "); top += vert_space; 1774 1806 -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r937 r945 327 327 OverlayElement *mDelayedTraversedNodesInfo; 328 328 OverlayElement *mCurrentObjectTypeInfo; 329 OverlayElement *mViewCellsInfo; 329 330 330 331 OverlayElement *mMyStatsAlgorithmInfo; 331 332 OverlayElement *mMyStatsFpsInfo; 332 333 334 OverlayElement *mMyLoadingInfo; 335 333 336 OverlayElement *mQueryTypeInfo; 334 337 OverlayElement *mQueryVisibleNodesInfo; … … 402 405 Overlay* mQueryOverlay; 403 406 Overlay* mMyStatsOverlay; 407 Overlay *mLoadingOverlay; 404 408 405 409 Light *mSunLight; … … 417 421 418 422 int mCurrentObjectType; 419 423 420 424 bool mDeleteObjects; 421 425 bool mRecordVideo; -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r937 r945 149 149 150 150 151 /************************************************************** /152 /* TestCullingTerrainApplication implementation*/153 /************************************************************** /151 /********************************************************************/ 152 /* TestCullingTerrainApplication implementation */ 153 /********************************************************************/ 154 154 155 155 … … 159 159 mIVReader(NULL), 160 160 mFilename("terrain"), 161 mEnvironmentFilename(" simple.env")161 mEnvironmentFilename("generate_viewcells.env") 162 162 { 163 163 } … … 335 335 mIVReader = new IVReader(); 336 336 337 Timer *timer = PlatformManager::getSingleton().createTimer(); 338 timer->reset(); 337 339 if (1) 338 340 { … … 350 352 351 353 mIVReader->buildTree(mSceneMgr, node); 354 355 mIVReader->collapse(); 352 356 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 353 371 return true; 354 372 } 355 373 356 mIVReader->collapse();357 358 //-- bake into static geometry359 if (USE_STATIC_GEOMETRY)360 {361 BakeSceneIntoStaticGeometry("staticVienna", "Vienna");362 }363 364 OGRE_DELETE(mIVReader);365 374 366 375 return false; … … 391 400 //roofsNode->detachAllObjects(); 392 401 //roadsNode->detachAllObjects(); 393 // 402 //planeNode->detachAllObjects(); 394 403 395 404 //viennaNode->removeChild("Walls"); … … 470 479 471 480 mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5)); 472 473 481 474 482 //-- terrain content setup … … 485 493 486 494 mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 487 488 495 496 if (!msShowHillyTerrain) 497 return; 498 489 499 // if no objects in file, we generate new objects 490 if ( msShowHillyTerrain &&!mTerrainContentGenerator->LoadObjects("objects.out"))500 if (!mTerrainContentGenerator->LoadObjects("objects.out")) 491 501 { 492 502 // the objects are generated randomly distributed over the terrain
Note: See TracChangeset
for help on using the changeset viewer.