Changeset 1604 for GTP/trunk/App/Demos
- Timestamp:
- 10/10/06 16:43:07 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
r1596 r1604 115 115 mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING), 116 116 mNodeVizMode(NODEVIZ_NONE), 117 mVizCameraHeight(Real( 4000.0)),117 mVizCameraHeight(Real(2000.0)), 118 118 mCamNode(camNode), 119 119 mAppState(WALKTHROUGH), … … 128 128 mRMouseDown(false), 129 129 mShowOctree(false), 130 mShowViewCells(false), 130 131 mUseDepthPass(false), 131 132 mTestGeometryForVisibleLeaves(false), … … 243 244 244 245 mSceneMgr->setOption("ShowOctree", &mShowOctree); 246 mSceneMgr->setOption("ShowViewCells", &mShowViewCells); 245 247 mSceneMgr->setOption("CullCamera", &mCullCamera); 246 248 mSceneMgr->setOption("PrepareVisualization", &mShowVisualization); … … 444 446 } 445 447 446 //-- set parameters for visualization447 448 if (mShowVisualization) 448 449 { 450 //////////////// 451 //-- set parameters for visualization 452 449 453 // important for visualization => draw octree bounding boxes 450 //mSceneMgr->setOption("ShowOctree", &mShowVisualization); 454 if (0) 455 mSceneMgr->setOption("ShowOctree", &mShowVisualization); 451 456 452 457 /////////////// … … 466 471 -mCamera->getDerivedDirection().z)); 467 472 473 const float moveFactor = 200; 468 474 // move by a constant so view plane is on bottom of viewport 469 mVizCamera->moveRelative(Vector3(0, 800, 0));475 mVizCamera->moveRelative(Vector3(0, moveFactor, 0)); 470 476 } 471 477 else … … 1185 1191 mShowOctree = !mShowOctree; 1186 1192 mSceneMgr->setOption("ShowOctree", &mShowOctree); 1193 } 1194 //----------------------------------------------------------------------- 1195 void TerrainFrameListener::toggleShowViewCells() 1196 { 1197 mShowViewCells = !mShowViewCells; 1198 mSceneMgr->setOption("ShowViewCells", &mShowViewCells); 1187 1199 } 1188 1200 //----------------------------------------------------------------------- … … 1363 1375 1364 1376 case KC_C: 1365 1366 1377 if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY) 1378 { 1367 1379 mItemBufferMode = GtpVisibility::QueryManager::GEOMETRY_VISIBILITY; 1380 } 1368 1381 else 1382 { 1369 1383 mItemBufferMode = GtpVisibility::QueryManager::PATCH_VISIBILITY; 1370 1384 } 1371 1385 break; 1372 1386 … … 1378 1392 break; 1379 1393 1394 /////////////// 1380 1395 //-- visualization 1381 1396 case KC_1: … … 1396 1411 toggleRecord(); 1397 1412 break; 1398 #if USE_PERFHUD1413 //#if USE_PERFHUD 1399 1414 case KC_F1: 1400 1415 toggleShowHelp(); … … 1413 1428 applyObjectType(); 1414 1429 break; 1415 #endif 1430 //#endif 1431 1416 1432 case KC_F8: 1417 mApplication->generateScene(500, mCurrentObjectType); 1433 { // generate new objects 1434 const int objNum = 500; 1435 mApplication->generateScene(objNum, mCurrentObjectType); 1436 } 1418 1437 break; 1419 1438 case KC_F9: … … 1432 1451 case KC_8: 1433 1452 changeAssumedVisibility(-5); 1434 //changeAssumedVisibility(-500);1453 // changeAssumedVisibility(-500); 1435 1454 break; 1436 1455 case KC_9: 1437 // changeAssumedVisibility(500);1438 1456 changeAssumedVisibility(5); 1457 // changeAssumedVisibility(500); 1439 1458 break; 1440 1459 case KC_LSHIFT: … … 1455 1474 case KC_V: 1456 1475 toggleUseViewCells(); 1476 break; 1477 case KC_L: 1478 toggleShowViewCells(); 1457 1479 break; 1458 1480 case KC_Q: -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r1271 r1604 210 210 void changeVizScale(const int incr); 211 211 void setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves); 212 /** Shows octree hierarchy of the scene.212 /** Shows visualization of octree hierarchy nodes. 213 213 */ 214 214 void toggleShowOctree(); 215 /** Shows visualization of the view cells. 216 */ 217 void toggleShowViewCells(); 215 218 /** Toggles between view cells / no view cells. 216 219 */ … … 353 356 bool mTestGeometryForVisibleLeaves; 354 357 bool mShowOctree; 358 bool mShowViewCells; 355 359 bool mUseDepthPass; 356 360 bool mShowVisualization; -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r1593 r1604 239 239 GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING; 240 240 } 241 else // default rendering 242 { 243 mAlgorithm = 244 GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS; 245 } 241 246 } 242 247 … … 289 294 mCamNode->attachObject(mCamera); 290 295 296 /////////////////// 291 297 //-- create visualization camera 298 292 299 mVizCamera = mSceneMgr->createCamera("VizCam"); 293 300 mVizCamera->setPosition(mCamNode->getPosition()); … … 700 707 if (rit->movable->getName() != "PlayerCam") 701 708 { 702 mCamNode->setPosition(mCamNode->getPosition().x, 709 mCamNode->setPosition( 710 mCamNode->getPosition().x, 703 711 rit->movable->getWorldBoundingBox().getCenter().y + 2, 704 712 mCamNode->getPosition().z); 705 713 706 /*707 std::stringstream d;708 d << "World: " << it->movable->getWorldBoundingBox().getCenter().y <<709 ", Object: " << it->movable->getBoundingBox().getCenter().y <<710 ", Camera: " << mCamera->getDerivedPosition();711 712 LogManager::getSingleton().logMessage(d.str());*/713 714 714 return true; 715 715 } -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.h
r1271 r1604 29 29 { 30 30 public: 31 31 32 VisualizationRenderTargetListener(SceneManager *sceneMgr); 32 33
Note: See TracChangeset
for help on using the changeset viewer.