Changeset 2455 for GTP/trunk/App/Demos/Vis
- Timestamp:
- 06/14/07 17:24:08 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Vis
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
r2359 r2455 135 135 mUseDepthPass(false), 136 136 mTestGeometryForVisibleLeaves(false), 137 mTestGeometryBounds(false), 137 138 mShowVisualization(false), 138 139 mCullCamera(false), … … 165 166 mUseViewCells(false), 166 167 mViewCellsLoaded(false), 167 mUseVisibilityFilter(false),168 168 mFloorDist(2), 169 169 mFlushQueue(false), … … 171 171 m_iBoundingBoxLevel(0) 172 172 { 173 //mInputDevice = PlatformManager::getSingleton().createInputReader();174 //mInputDevice->initialise(win, true, true);175 176 173 mEventProcessor = new EventProcessor(); 177 174 … … 242 239 // the scale factor for the visualized bounding boxes 243 240 mSceneMgr->setOption("NodeVizScale", &mVizScale); 244 245 ///////// 246 //-- set the current culling algorithm type 247 //setAlgorithm(mApplication->mAlgorithm); 241 242 int assumedIncr; 243 mSceneMgr->getOption("AssumedVisibility", &assumedIncr); 244 changeAssumedVisibility(assumedIncr); 245 246 ///// 247 // test geometry boundaries instead bounding box 248 mSceneMgr->getOption("TestGeometryBounds", &mTestGeometryBounds); 249 setTestGeometryBounds(mTestGeometryBounds); 250 251 ///////////////////////////////// 252 // culling algorithm 248 253 249 254 bool isNormalExecution; 250 255 251 256 mSceneMgr->getOption("NormalExecution", &isNormalExecution); 257 252 258 if (isNormalExecution) 253 259 { 254 260 // no algorithm 255 mCurrentAlgorithm = 256 GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS; 261 mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS; 257 262 } 258 263 else … … 261 266 } 262 267 268 // apply the chosen culling algorithm 263 269 applyCurrentAlgorithm(); 264 270 271 265 272 /////////////////////////////// 266 267 273 // set scene manager options 274 275 ////////// 276 mSceneMgr->getOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 268 277 setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 269 278 270 // mSceneMgr->setOption("UseDepthPass", &mUseDepthPass);279 ///////////// 271 280 mSceneMgr->getOption("UseDepthPass", &mUseDepthPass); 272 281 … … 278 287 mSceneMgr->getOption("FlushQueue", &mFlushQueue); 279 288 289 ////////// 280 290 if (mFlushQueue) 281 291 LogManager::getSingleton().logMessage("initial setting: flushing queue"); … … 283 293 LogManager::getSingleton().logMessage("initial setting: not flushing queue"); 284 294 295 ///////////// 285 296 mSceneMgr->setOption("ShowOctree", &mShowOctree); 286 297 mSceneMgr->setOption("ShowViewCells", &mShowViewCells); … … 290 301 applyObjectType(); 291 302 292 // initialise timer 303 304 /////////////// 305 // initialize timer 306 293 307 mTimer = Root::getSingleton().getTimer(); 294 308 mTimeFrameEnded = mTimeFrameStarted = mTimer->getMilliseconds(); 295 309 296 // init view cell parameters297 mSceneMgr->setOption("UseVisibilityFilter", &mUseVisibilityFilter);298 299 310 // reset statistics 300 311 mWalkthroughStats.Reset(); … … 863 874 mFrameInfo.push_back(info); 864 875 865 // std::stringstream d; d << StringConverter::toString(info.position) << " " << StringConverter::toString(info.orientation);866 // LogManager::getSingleton().logMessage(d.str());867 876 ++ i; 868 877 } … … 892 901 // we produced precomputed fps during the last replay => 893 902 // save them to file 894 if (mSavePrecomputedFps) //!mPrecomputedFpsFrameInfo.empty())903 if (mSavePrecomputedFps) 895 904 { 896 905 std::string filename = msApprevAlgorithmCaptions[mCurrentAlgorithm] + "_frames.out"; … … 997 1006 998 1007 if (mAssumedVisibility < 0) 999 {1000 1008 mAssumedVisibility = 0; 1001 }1002 1009 1003 1010 char str[100]; sprintf(str,": %d", mAssumedVisibility); … … 1229 1236 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 1230 1237 1231 /* disable optimization which tests geometry instead of aabb 1232 * for "delayed" rendering of transparents (i.e., render transparents after all the solids) 1233 * because otherwise visible transparents could be skipped 1234 */ 1235 bool delayedRendering = !mTestGeometryForVisibleLeaves; 1236 1237 mSceneMgr->setOption("DelayRenderTransparents", &delayedRendering); 1238 1238 // disable optimization for transparent objects, becaue otherwise visible 1239 // transparents could be skipped 1239 1240 if (mTestGeometryForVisibleLeaves) 1240 {1241 1241 mTestGeometryForVisibleLeavesInfo->setCaption(": true"); 1242 }1243 1242 else 1244 {1245 1243 mTestGeometryForVisibleLeavesInfo->setCaption(": false"); 1246 } 1247 } 1244 } 1245 //----------------------------------------------------------------------- 1246 void TerrainFrameListener::setTestGeometryBounds(bool testGeometryBounds) 1247 { 1248 mSceneMgr->setOption("TestGeometryBounds", &mTestGeometryBounds); 1249 1250 if (mTestGeometryBounds) 1251 LogManager::getSingleton().logMessage("Testing geometry boundaries"); 1252 else 1253 LogManager::getSingleton().logMessage("Testing bounding box of hierarchy node"); 1254 } 1255 1248 1256 //----------------------------------------------------------------------- 1249 1257 void TerrainFrameListener::toggleShowOctree() … … 1293 1301 } 1294 1302 //----------------------------------------------------------------------- 1295 void TerrainFrameListener::toggleUseVisibilityFilter()1296 {1297 mUseVisibilityFilter = !mUseVisibilityFilter;1298 mSceneMgr->setOption("UseVisibilityFilter", &mUseVisibilityFilter);1299 }1300 //-----------------------------------------------------------------------1301 1303 void TerrainFrameListener::toggleUseDepthPass() 1302 1304 { … … 1485 1487 break; 1486 1488 case KC_Q: 1487 toggleUseVisibilityFilter(); 1489 mTestGeometryBounds = !mTestGeometryBounds; 1490 setTestGeometryBounds(mTestGeometryBounds); 1488 1491 break; 1489 1492 case KC_R: -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r2359 r2455 224 224 void changeAssumedVisibility(int incr); 225 225 void changeVizScale(const int incr); 226 226 227 void setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves); 228 229 void setTestGeometryBounds(bool testGeometryBounds); 230 227 231 /** Shows visualization of octree hierarchy nodes. 228 232 */ 229 233 void toggleShowOctree(); 234 230 235 /** Shows visualization of the view cells. 231 236 */ 232 237 void toggleShowViewCells(); 238 233 239 /** Toggles between view cells / no view cells. 234 240 */ 235 241 void toggleUseViewCells(); 236 237 void toggleUseVisibilityFilter();238 242 239 243 /** Toggles whether we use the initial depth pass. … … 372 376 OverlayElement *mQueryGeometryVisibilityInfo; 373 377 OverlayElement *mQueryPatchVisibilityInfo; 374 //OverlayElement *mHelpInfo;375 378 376 379 RayQueryExecutor *mRayQueryExecutor; … … 378 381 379 382 bool mTestGeometryForVisibleLeaves; 383 bool mTestGeometryBounds; 384 380 385 bool mShowOctree; 381 386 bool mShowViewCells; … … 389 394 bool mShowHelp; 390 395 bool mStatsOn; 396 397 398 //////// 399 //-- true if the mouse buttons are down 400 391 401 bool mLMouseDown; 392 // True if the mouse buttons are down393 402 bool mRMouseDown; 394 403 bool mShutdownRequested; … … 397 406 bool mUseAnimation; 398 407 408 399 409 int mItemBufferMode; 400 410 … … 410 420 411 421 Real mReplayTimeElapsed; 412 //EventProcessor* mEventProcessor;413 422 InputReader* mInputDevice; 414 423 Camera* mCamera; … … 446 455 bool mShowQueryStats; 447 456 448 //bool mUseBufferedInputKeys, mUseBufferedInputMouse, mInputTypeSwitchingOn;449 457 PlatformQueryManager *mQueryManager; 450 458 … … 467 475 bool mUseViewCells; 468 476 bool mViewCellsLoaded; 469 bool mUseVisibilityFilter;470 477 471 478 float mFloorDist; -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r2401 r2455 25 25 26 26 27 //using namespace GtpVisibility;28 27 29 28 /*************************************************************/ … … 478 477 if (0) generateScene(1000, 2); // create trees 479 478 } 480 int MaxDepth=30; 481 mSceneMgr->setOption("BiHierarchyMaxDepth", &MaxDepth); 482 int Mode=1; 483 mSceneMgr->setOption("EnhancedVisibility", &Mode); 479 480 int maxDepth = 30; 481 482 mSceneMgr->setOption("BiHierarchyMaxDepth", &maxDepth); 483 484 int mode = 1; 485 486 mSceneMgr->setOption("EnhancedVisibility", &mode); 484 487 mSceneMgr->setOption("RebuildBiHierarchy", NULL); 485 488 mSceneMgr->setOption("RebuildKdTree", NULL); … … 509 512 //-- add animation state for new robots (located at the end of the list) 510 513 511 for ( int i = (int)entList->size() - num; i < (int)entList->size(); ++i)514 for (size_t i = entList->size() - (unsigned int)num; i < entList->size(); ++ i) 512 515 { 513 516 mEntityStates.push_back(new EntityState((*entList)[i], -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h
r2382 r2455 78 78 NODEVIZ_RENDER_NODES, 79 79 NODEVIZ_RENDER_NODES_AND_CONTENT, 80 NODEVIZ_RENDER_PVS, 80 81 NODEVIZ_MODES_NUM 81 82 }; -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp
r2382 r2455 517 517 mSceneMgr->setOption("RenderNodesForViz", &renderNodesForViz); 518 518 mSceneMgr->setOption("RenderNodesContentForViz", &renderNodesContentForViz); 519 mSceneMgr->setOption("RenderPvsForViz", &renderPvs );519 mSceneMgr->setOption("RenderPvsForViz", &renderPvsForViz); 520 520 521 521 } … … 1779 1779 for (size_t i = 0; i < mDemoFPS.size(); i ++) 1780 1780 { 1781 logheader << (i +1) << fs;1781 logheader << (i + 1) << fs; 1782 1782 } 1783 1783 // minFPS, avgFPS, maxFPS, frames, time, render system, comment, record separator
Note: See TracChangeset
for help on using the changeset viewer.