Changeset 2501 for GTP/trunk/App/Demos
- Timestamp:
- 07/03/07 14:28:12 (17 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
r2455 r2501 169 169 mFlushQueue(false), 170 170 m_iShowBoundingBoxes(0), 171 m_iBoundingBoxLevel(0) 171 m_iBoundingBoxLevel(0), 172 mMoveFactor(1000) 172 173 { 173 174 mEventProcessor = new EventProcessor(); … … 231 232 mLoadingOverlay->hide(); 232 233 233 // note: larger magnification for terrain to show single objects234 // hack: larger magnification for terrain to show single objects 234 235 if (TestCullingTerrainApplication::msShowHillyTerrain) 235 236 mVizScale = 25; … … 522 523 523 524 // move by a constant so view plane is on "bottom" of viewport 524 const float moveFactor = 1000; 525 mVizCamera->moveRelative(Vector3(0, moveFactor, 0)); 525 mVizCamera->moveRelative(Vector3(0, mMoveFactor, 0)); 526 526 } 527 527 else … … 555 555 mWindow->setDebugText("Recording frame " + 556 556 StringConverter::toString((int)mFrameInfo.size() - 1)); 557 } 557 } 558 558 559 // move camera according to input 559 560 moveCamera(); … … 1019 1020 1020 1021 if (mVizScale < 1) 1021 {1022 1022 mVizScale = 1; 1023 }1024 1023 1025 1024 mSceneMgr->setOption("NodeVizScale", &mVizScale); … … 1431 1430 break; 1432 1431 1432 // assumed visible #frames 1433 case KC_9: 1434 changeAssumedVisibility(-5); 1435 break; 1436 case KC_0: 1437 changeAssumedVisibility(5); 1438 break; 1439 1433 1440 case KC_ESCAPE: 1434 1441 mShutdownRequested = true; 1435 1442 e->consume(); 1436 1443 return; 1437 1444 // the visibility algorithm 1438 1445 case KC_SPACE: 1439 1446 nextAlgorithm(); 1440 1447 break; 1441 1442 1448 case KC_LSHIFT: 1443 1449 mShiftPressed = true; … … 1446 1452 mDeleteObjects = true; 1447 1453 break; 1448 1454 // not working yet 1449 1455 case KC_C: 1450 1456 if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY) … … 1460 1466 mSavePrecomputedFps = !mSavePrecomputedFps; 1461 1467 break; 1462 1463 1468 case KC_F: 1464 1469 nextFilter(); … … 1483 1488 toggleDisplayCameraDetails(); 1484 1489 break; 1490 // if view cells + PVS are used for rendering 1485 1491 case KC_V: 1486 1492 toggleUseViewCells(); … … 1522 1528 1523 1529 1524 1525 1530 /////////////// 1526 1531 //-- visualization … … 1532 1537 nextNodeVizMode(); 1533 1538 break; 1534 case KC_7: 1535 { 1539 1540 case KC_F12: 1541 { 1542 LogManager::getSingleton().logMessage("generating 500 objects"); 1536 1543 // generate new objects 1537 1544 const int numObjects = 500; … … 1539 1546 } 1540 1547 break; 1541 case KC_8:1542 changeAssumedVisibility(-5);1543 // changeAssumedVisibility(-500);1544 break;1545 case KC_9:1546 changeAssumedVisibility(5);1547 // changeAssumedVisibility(500);1548 break;1549 1550 //#if USE_PERFHUD1551 1548 case KC_F1: 1552 1549 toggleShowHelp(); … … 1562 1559 toggleRecord(); 1563 1560 break; 1564 1565 1561 case KC_F5: 1566 1562 { 1567 unsigned int pixels = 0; 1568 mSceneMgr->getOption("VisibleObjects", &pixels); 1569 1570 std::stringstream d; d << "visible objects: " << pixels; 1571 LogManager::getSingleton().logMessage(d.str()); 1572 const bool fromPoint = false; 1573 //applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer); 1563 mSceneMgr->_findVisibleObjects(mCamera, false); 1564 if (0) applyVisibilityQuery(false, mShiftPressed, mUseItemBuffer); 1574 1565 break; 1575 1566 } 1576 1577 1567 case KC_F6: 1578 1568 { 1579 1569 const bool fromPoint = true; 1580 applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer);1570 if (1) applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer); 1581 1571 break; 1582 1572 } 1573 // change type of object to be generated 1583 1574 case KC_F7: 1584 1575 ++ mCurrentObjectType; 1585 1576 applyObjectType(); 1586 1577 break; 1587 //#endif1588 1589 1578 case KC_F8: 1590 1591 1579 mTerrainContentGenerator->WriteObjects(objects_out_filename); 1592 1580 break; 1593 1594 1581 case KC_F9: 1595 1582 mUseAnimation = !mUseAnimation; 1596 1583 break; 1597 1598 1584 case KC_F10: 1599 1585 mRecordVideo = !mRecordVideo; 1600 1586 break; 1601 1587 case KC_F11: 1602 1588 takeScreenshot(); 1603 1589 break; 1604 1605 case KC_F12:1606 break;1607 //KEY_PRESSED(KC_F3, 0.3, writeFrames());1608 //KEY_PRESSED(KC_F4, 0.3, loadFrames());1609 1590 default: 1610 1591 break; … … 1735 1716 cursorPressed = true; 1736 1717 } 1718 1737 1719 // visualization camera 1738 1720 if (mInputDevice->isKeyDown(KC_3)) 1739 {1740 1721 zoomVizCamera(50); 1741 } 1722 1742 1723 if (mInputDevice->isKeyDown(KC_4)) 1743 {1744 1724 zoomVizCamera(-50); 1745 } 1746 1725 1726 // scale of the visualized objects 1727 #if 0 1747 1728 if (mInputDevice->isKeyDown(KC_5)) 1748 {1749 1729 changeVizScale(-1); 1750 }1751 1730 1752 1731 if (mInputDevice->isKeyDown(KC_6)) 1753 {1754 1732 changeVizScale(1); 1755 } 1756 1733 #else 1734 1735 const int mFactor = 20; 1736 if (mInputDevice->isKeyDown(KC_5)) 1737 mMoveFactor += mFactor; 1738 1739 if (mInputDevice->isKeyDown(KC_6)) 1740 mMoveFactor -= mFactor; 1741 #endif 1742 1743 // distance to floor 1757 1744 if (mInputDevice->isKeyDown(KC_7)) 1758 {1759 1745 changeFloorDist(-1); 1760 } 1761 1746 1762 1747 if (mInputDevice->isKeyDown(KC_8)) 1763 {1764 1748 changeFloorDist(1); 1765 }1766 1749 1767 1750 -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r2455 r2501 477 477 478 478 float mFloorDist; 479 480 int mMoveFactor; 479 481 }; 480 482 -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj
r2353 r2501 98 98 LinkIncremental="1" 99 99 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)";..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;"..\..\..\..\..\Lib\Vis\Preprocessing\lib\$(ConfigurationName)"" 100 GenerateDebugInformation=" TRUE"100 GenerateDebugInformation="FALSE" 101 101 SubSystem="2" 102 102 OptimizeReferences="2" -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r2455 r2501 229 229 mCamNode->attachObject(mCamera); 230 230 231 231 232 /////////////////// 232 233 //-- create visualization camera … … 436 437 // was terrain loaded? 437 438 mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 438 msShowHillyTerrain=true;439 440 439 441 440 // hack view point for terrain … … 638 637 float minVal = 999999999999; 639 638 639 // find next valid intersection 640 640 while (rit != qryResult.end() && rit->movable) 641 641 { 642 // camera is not a real world object 642 643 if (rit->movable->getName() != "PlayerCam") 643 644 { 644 // place on the groundobject645 // get the next intersection with a movable object 645 646 yVal = rit->movable->getWorldBoundingBox().getCenter().y; 646 if (yVal < minVal) 647 minVal = yVal; 648 649 //std::stringstream d; d << "dist: " << dist << endl; 650 //Ogre::LogManager() 647 648 if (yVal < minVal) 649 minVal = yVal; 650 651 651 success = true; 652 652 } … … 654 654 ++ rit; 655 655 } 656 657 // place on the ground object656 657 // place player on the ground object 658 658 if (success) 659 mCamNode->setPosition( 660 mCamNode->getPosition().x, 661 minVal + dist, 662 mCamNode->getPosition().z); 659 { 660 mCamNode->setPosition(mCamNode->getPosition().x, 661 minVal + dist, 662 mCamNode->getPosition().z); 663 } 663 664 664 665 OGRE_DELETE(raySceneQuery); … … 741 742 742 743 744 743 745 /**********************************************************************/ 744 746 /* VisualizationRenderTargetListener implementation */ 745 747 /**********************************************************************/ 746 748 747 748 749 //----------------------------------------------------------------------- 749 750 VisualizationRenderTargetListener::VisualizationRenderTargetListener(SceneManager *sceneMgr)
Note: See TracChangeset
for help on using the changeset viewer.