Changeset 2352
- Timestamp:
- 05/07/07 17:52:44 (18 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
r2305 r2352 30 30 "RUC", 31 31 "SWC", 32 "DEF" 32 "DEF", 33 "INT" 33 34 }; 34 35 … … 166 167 mUseVisibilityFilter(false), 167 168 mFloorDist(2), 168 mFlushQueue(false) 169 mFlushQueue(false), 170 m_iShowBoundingBoxes(0), 171 m_iBoundingBoxLevel(0) 169 172 { 170 173 //mInputDevice = PlatformManager::getSingleton().createInputReader(); … … 1326 1329 } 1327 1330 1331 void TerrainFrameListener::showBoundingBoxes() 1332 { 1333 m_iShowBoundingBoxes++; 1334 m_iShowBoundingBoxes%=2; 1335 mSceneMgr->setOption("ShowBiHierarchy", (void*)&m_iShowBoundingBoxes); 1336 } 1337 1338 1328 1339 //----------------------------------------------------------------------- 1329 1340 void TerrainFrameListener::toggleShowViz() … … 1486 1497 mCamNode->resetOrientation(); 1487 1498 break; 1499 case KC_B: 1500 showBoundingBoxes(); 1501 break; 1502 case KC_3: 1503 if (m_iBoundingBoxLevel>0) m_iBoundingBoxLevel--; 1504 mSceneMgr->setOption("HiLiteLevel", (void*)&m_iBoundingBoxLevel); 1505 break; 1506 case KC_4: 1507 m_iBoundingBoxLevel++; 1508 mSceneMgr->setOption("HiLiteLevel", (void*)&m_iBoundingBoxLevel); 1509 break; 1510 1488 1511 1489 1512 -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r2305 r2352 211 211 /** Takes one video frame. 212 212 */ 213 214 void showBoundingBoxes(); 213 215 void takeVideoFrame(std::ofstream &ofstr); 214 216 … … 308 310 int mNumVideoFrames; 309 311 /// the newly created object 312 int m_iShowBoundingBoxes; 313 int m_iBoundingBoxLevel; 310 314 SceneNode *mCurrentObject; 311 315 -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r2305 r2352 432 432 // terrain creation 433 433 std::string terrain_cfg("terrainCulling.cfg"); 434 434 435 mSceneMgr->setWorldGeometry(terrain_cfg); 435 436 436 437 // was terrain loaded? 437 438 mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 439 msShowHillyTerrain=true; 440 438 441 439 442 // hack view point for terrain … … 471 474 { 472 475 // the objects are generated randomly distributed over the terrain 473 if (1) generateScene( 1500, 0); // create robots474 if (0) generateScene( 100, 1); // create ninjas476 if (1) generateScene(500, 0); // create robots 477 if (0) generateScene(300, 1); // create ninjas 475 478 if (0) generateScene(1000, 2); // create trees 476 479 } 480 int MaxDepth=30; 481 mSceneMgr->setOption("BiHierarchyMaxDepth", &MaxDepth); 482 int Mode=1; 483 mSceneMgr->setOption("EnhancedVisibility", &Mode); 484 mSceneMgr->setOption("RebuildBiHierarchy", NULL); 485 mSceneMgr->setOption("RebuildKdTree", NULL); 477 486 } 478 487 //----------------------------------------------------------------------- … … 564 573 this); 565 574 566 mTerrainFrameListener->setPriority(10);567 mTerrainFrameListener->setPriority(10);568 mRoot->addFrameListener(mTerrainFrameListener); 575 //mTerrainFrameListener->setPriority(10); 576 //mTerrainFrameListener->setPriority(10); 577 mRoot->addFrameListener(mTerrainFrameListener); 569 578 } 570 579 //----------------------------------------------------------------------- … … 583 592 #else 584 593 585 mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");586 587 //mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 594 //mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager"); 595 596 //mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 588 597 //mSceneMgr = mRoot->createSceneManager("OctreeSceneManager"); 589 590 //mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager"); 598 //mSceneMgr = mRoot->createSceneManager("BiHierarchySceneManager"); 599 600 mSceneMgr = mRoot->createSceneManager("BiTreeTerrainSceneManager"); 591 601 592 602 #endif
Note: See TracChangeset
for help on using the changeset viewer.