Ignore:
Timestamp:
07/03/07 14:28:12 (17 years ago)
Author:
mattausch
Message:
 
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  
    169169mFlushQueue(false), 
    170170m_iShowBoundingBoxes(0), 
    171 m_iBoundingBoxLevel(0) 
     171m_iBoundingBoxLevel(0), 
     172mMoveFactor(1000) 
    172173{ 
    173174        mEventProcessor = new EventProcessor(); 
     
    231232        mLoadingOverlay->hide(); 
    232233 
    233         // note: larger magnification for terrain to show single objects 
     234        // hack: larger magnification for terrain to show single objects 
    234235        if (TestCullingTerrainApplication::msShowHillyTerrain) 
    235236                mVizScale = 25; 
     
    522523                 
    523524                // 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)); 
    526526        } 
    527527        else 
     
    555555                        mWindow->setDebugText("Recording frame " +  
    556556                                StringConverter::toString((int)mFrameInfo.size() - 1)); 
    557                 }        
     557                } 
     558 
    558559                // move camera according to input 
    559560                moveCamera(); 
     
    10191020 
    10201021        if (mVizScale < 1)  
    1021         {        
    10221022                mVizScale = 1; 
    1023         } 
    10241023 
    10251024        mSceneMgr->setOption("NodeVizScale", &mVizScale); 
     
    14311430                break; 
    14321431 
     1432        // assumed visible #frames 
     1433        case KC_9: 
     1434                changeAssumedVisibility(-5); 
     1435                break; 
     1436        case KC_0: 
     1437                changeAssumedVisibility(5); 
     1438                break; 
     1439 
    14331440        case KC_ESCAPE: 
    14341441                mShutdownRequested = true; 
    14351442                e->consume(); 
    14361443                return; 
    1437  
     1444        // the visibility algorithm 
    14381445        case KC_SPACE: 
    14391446                nextAlgorithm(); 
    14401447                break; 
    1441  
    14421448        case KC_LSHIFT: 
    14431449                mShiftPressed = true; 
     
    14461452                mDeleteObjects = true; 
    14471453                break; 
    1448  
     1454        // not working yet 
    14491455        case KC_C: 
    14501456                if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY) 
     
    14601466                mSavePrecomputedFps = !mSavePrecomputedFps; 
    14611467                break; 
    1462  
    14631468    case KC_F: 
    14641469                nextFilter(); 
     
    14831488                toggleDisplayCameraDetails(); 
    14841489                break; 
     1490        // if view cells + PVS are used for rendering 
    14851491        case KC_V: 
    14861492                toggleUseViewCells(); 
     
    15221528 
    15231529 
    1524  
    15251530        /////////////// 
    15261531        //-- visualization 
     
    15321537                nextNodeVizMode(); 
    15331538                break; 
    1534         case KC_7: 
    1535                 { 
     1539         
     1540        case KC_F12: 
     1541                { 
     1542                        LogManager::getSingleton().logMessage("generating 500 objects"); 
    15361543                        // generate new objects 
    15371544                        const int numObjects = 500; 
     
    15391546                } 
    15401547                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_PERFHUD 
    15511548        case KC_F1: 
    15521549                toggleShowHelp(); 
     
    15621559                toggleRecord(); 
    15631560                break; 
    1564  
    15651561        case KC_F5: 
    15661562                { 
    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); 
    15741565                        break; 
    15751566                } 
    1576  
    15771567        case KC_F6: 
    15781568                { 
    15791569                        const bool fromPoint = true; 
    1580                         applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer); 
     1570                        if (1) applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer); 
    15811571                        break; 
    15821572                }        
     1573        // change type of object to be generated 
    15831574        case KC_F7: 
    15841575                ++ mCurrentObjectType; 
    15851576                applyObjectType(); 
    15861577                break; 
    1587 //#endif 
    1588  
    15891578        case KC_F8: 
    1590  
    15911579                mTerrainContentGenerator->WriteObjects(objects_out_filename); 
    15921580                break; 
    1593  
    15941581        case KC_F9: 
    15951582                mUseAnimation = !mUseAnimation; 
    15961583                break; 
    1597  
    15981584        case KC_F10: 
    15991585                mRecordVideo = !mRecordVideo; 
    1600                          
     1586                break;           
    16011587        case KC_F11: 
    16021588                takeScreenshot(); 
    16031589                break; 
    1604          
    1605         case KC_F12: 
    1606                 break; 
    1607         //KEY_PRESSED(KC_F3, 0.3, writeFrames()); 
    1608         //KEY_PRESSED(KC_F4, 0.3, loadFrames()); 
    16091590        default: 
    16101591                break; 
     
    17351716                cursorPressed = true; 
    17361717    } 
     1718 
    17371719        // visualization camera 
    17381720        if (mInputDevice->isKeyDown(KC_3)) 
    1739         { 
    17401721                zoomVizCamera(50); 
    1741         } 
     1722 
    17421723        if (mInputDevice->isKeyDown(KC_4)) 
    1743         { 
    17441724                zoomVizCamera(-50); 
    1745         } 
    1746  
     1725 
     1726        // scale of the visualized objects 
     1727#if 0 
    17471728        if (mInputDevice->isKeyDown(KC_5)) 
    1748         { 
    17491729                changeVizScale(-1); 
    1750         } 
    17511730 
    17521731        if (mInputDevice->isKeyDown(KC_6)) 
    1753         { 
    17541732                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 
    17571744        if (mInputDevice->isKeyDown(KC_7)) 
    1758         { 
    17591745                changeFloorDist(-1); 
    1760         } 
    1761          
     1746 
    17621747        if (mInputDevice->isKeyDown(KC_8)) 
    1763         { 
    17641748                changeFloorDist(1); 
    1765         } 
    17661749 
    17671750 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h

    r2455 r2501  
    477477 
    478478        float mFloorDist; 
     479 
     480        int mMoveFactor; 
    479481}; 
    480482 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj

    r2353 r2501  
    9898                                LinkIncremental="1" 
    9999                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;&quot;..\..\..\..\..\Lib\Vis\Preprocessing\lib\$(ConfigurationName)&quot;" 
    100                                 GenerateDebugInformation="TRUE" 
     100                                GenerateDebugInformation="FALSE" 
    101101                                SubSystem="2" 
    102102                                OptimizeReferences="2" 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r2455 r2501  
    229229        mCamNode->attachObject(mCamera); 
    230230         
     231 
    231232        /////////////////// 
    232233        //-- create visualization camera 
     
    436437        // was terrain loaded? 
    437438        mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain);  
    438         msShowHillyTerrain=true; 
    439  
    440439                 
    441440        // hack view point for terrain 
     
    638637        float minVal = 999999999999; 
    639638 
     639        // find next valid intersection 
    640640        while (rit != qryResult.end() && rit->movable) 
    641641        { 
     642                // camera is not a real world object 
    642643                if (rit->movable->getName() != "PlayerCam") 
    643644                { 
    644                         // place on the ground object 
     645                        // get the next intersection with a movable object 
    645646                        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 
    651651                        success = true; 
    652652                } 
     
    654654                ++ rit; 
    655655        } 
    656      
    657         // place on the ground object 
     656 
     657        // place player on the ground object 
    658658        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        } 
    663664 
    664665        OGRE_DELETE(raySceneQuery); 
     
    741742 
    742743 
     744 
    743745/**********************************************************************/ 
    744746/*           VisualizationRenderTargetListener implementation         */ 
    745747/**********************************************************************/ 
    746748 
    747  
    748749//----------------------------------------------------------------------- 
    749750VisualizationRenderTargetListener::VisualizationRenderTargetListener(SceneManager *sceneMgr) 
Note: See TracChangeset for help on using the changeset viewer.