Changeset 2108
- Timestamp:
- 02/09/07 03:05:52 (17 years ago)
- Location:
- GTP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
r2106 r2108 235 235 // the scale factor for the visualized bounding boxes 236 236 mSceneMgr->setOption("NodeVizScale", &mVizScale); 237 237 238 ///////// 238 239 //-- 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 /////////////////////////////// 240 259 241 260 // set scene manager options … … 481 500 // frame start time 482 501 mTimeFrameStarted = mTimer->getMilliseconds(); 483 //Ogre::LogManager::getSingleton().logMessage("Frame started");484 502 } 485 503 … … 517 535 { 518 536 mApplication->Clamp2Terrain(mCamNode, 5); 537 //Ogre::LogManager::getSingleton().logMessage("clamp to terrain"); 519 538 } 520 539 else 521 540 { 522 541 mApplication->Clamp2FloorPlane(mFloorDist); 542 //Ogre::LogManager::getSingleton().logMessage("clamp to floor"); 523 543 } 524 544 … … 526 546 527 547 default: 548 Ogre::LogManager::getSingleton().logMessage("should not come here"); 528 549 break; 529 550 }; -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r1607 r2108 78 78 //-- write out stats for recorded walkthrough 79 79 d << "Algorithm: " << algorithmName << "\n" 80 81 82 83 84 85 86 87 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"; 88 88 } 89 89 -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r2106 r2108 217 217 if (!val.empty()) 218 218 mInitialPosition.z = atof( val.c_str()); 219 220 219 */ 220 221 221 /* val = config.getSetting("OnlineCullingAlgorithm"); 222 222 … … 457 457 loadConfig("terrainCulling.cfg"); 458 458 459 if ( !LoadScene(mFilename))459 if (0 && !LoadScene(mFilename)) 460 460 LogManager::getSingleton().logMessage("error loading scene"); 461 461 … … 499 499 if (1)//||msShowHillyTerrain) 500 500 { 501 mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 502 std::string terrain_cfg("terrainCulling.cfg"); 501 std::string terrain_cfg("terrainCulling.cfg"); 503 502 mSceneMgr->setWorldGeometry(terrain_cfg); 504 503 504 mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 505 505 } 506 506 … … 660 660 } 661 661 #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 675 667 #endif 676 668 } … … 703 695 RaySceneQueryResult::iterator rit = qryResult.begin(); 704 696 bool success = false; 705 float yVal = 0; 706 float minVal = 999999999999; 697 698 float yVal = 0; 699 float minVal = 999999999999; 707 700 708 701 while (rit != qryResult.end() && rit->movable) … … 779 772 { 780 773 // terrain hack 781 msShowHillyTerrain = true;774 //msShowHillyTerrain = true; 782 775 LogManager::getSingleton().logMessage("error loading scene => load terrain"); 783 776 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2102 r2108 216 216 LogManager::getSingleton().logMessage("loading terrain"); 217 217 } 218 else 219 { 220 mShowTerrain = false; 221 LogManager::getSingleton().logMessage("loading geometry"); 222 } 218 223 } 219 224 … … 356 361 "TerrainSceneManager::loadConfig"); 357 362 } 363 358 364 TerrainPageSourceOptionList optlist; 359 365 ConfigFile::SettingsIterator setIt = config.getSettingsIterator(); … … 367 373 } 368 374 } 375 369 376 // set the page source 370 377 selectPageSource(pageSourceName, optlist); … … 394 401 } 395 402 396 // s et old view cell geometry to invisible403 // show current view cell geometry 397 404 if (mCurrentViewCell && mCurrentViewCell->GetMesh()) 398 405 { … … 906 913 mElementaryViewCell = NULL; 907 914 908 // with view cellsall objects are set to invisible per default915 // all objects are set to invisible per default 909 916 SetObjectsVisible(!mUseViewCells); 910 917 … … 936 943 return true; 937 944 } 945 if (key == "ShowTerrain") 946 { 947 mShowTerrain = *static_cast<const bool *>(val); 948 return true; 949 } 938 950 if (key == "UseVisibilityFilter") 939 951 { … … 942 954 // set null => recomputation of the pvs 943 955 mElementaryViewCell = NULL; 956 944 957 return true; 945 958 } … … 982 995 return true; 983 996 } 984 if (key == "AlgorithmType") 997 if (key == "NormalExecution") 998 { 999 * static_cast<bool *>(val) = (bool *)mNormalExecution; 1000 return true; 1001 } 1002 if (key == "Algorithm") 985 1003 { 986 1004 GtpVisibility::VisibilityEnvironment::CullingManagerType algorithm = … … 1683 1701 { 1684 1702 using namespace std; 1703 1685 1704 // use leaf nodes of the original spatial hierarchy as occludees 1686 1705 vector<string> filenames; 1687 1706 const int files = SplitFilenames(filename, filenames); 1688 1707 1689 st d::stringstream d;1708 stringstream d; 1690 1709 d << "number of input files: " << files << "\n"; 1691 1710 LogManager::getSingleton().logMessage(d.str()); … … 1702 1721 return false; 1703 1722 } 1704 /* 1723 1705 1724 for (fit = filenames.begin(); fit != fit_end; ++ fit, ++ i) 1706 1725 { … … 1720 1739 result = true; 1721 1740 } 1722 */ result=true; 1741 1723 1742 return result; 1724 1743 }
Note: See TracChangeset
for help on using the changeset viewer.