Changeset 1604


Ignore:
Timestamp:
10/10/06 16:43:07 (18 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

    r1596 r1604  
    115115mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING), 
    116116mNodeVizMode(NODEVIZ_NONE), 
    117 mVizCameraHeight(Real(4000.0)), 
     117mVizCameraHeight(Real(2000.0)), 
    118118mCamNode(camNode), 
    119119mAppState(WALKTHROUGH), 
     
    128128mRMouseDown(false), 
    129129mShowOctree(false), 
     130mShowViewCells(false), 
    130131mUseDepthPass(false), 
    131132mTestGeometryForVisibleLeaves(false), 
     
    243244         
    244245        mSceneMgr->setOption("ShowOctree", &mShowOctree); 
     246        mSceneMgr->setOption("ShowViewCells", &mShowViewCells); 
    245247        mSceneMgr->setOption("CullCamera", &mCullCamera); 
    246248        mSceneMgr->setOption("PrepareVisualization", &mShowVisualization); 
     
    444446        } 
    445447 
    446         //-- set parameters for visualization 
    447448        if (mShowVisualization) 
    448449        { 
     450                //////////////// 
     451                //-- set parameters for visualization 
     452 
    449453                // important for visualization => draw octree bounding boxes 
    450                 //mSceneMgr->setOption("ShowOctree", &mShowVisualization); 
     454                if (0) 
     455                        mSceneMgr->setOption("ShowOctree", &mShowVisualization); 
    451456                 
    452457                /////////////// 
     
    466471                        -mCamera->getDerivedDirection().z)); 
    467472                 
     473                const float moveFactor = 200; 
    468474                // 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)); 
    470476        } 
    471477        else 
     
    11851191        mShowOctree = !mShowOctree; 
    11861192        mSceneMgr->setOption("ShowOctree", &mShowOctree); 
     1193} 
     1194//----------------------------------------------------------------------- 
     1195void TerrainFrameListener::toggleShowViewCells() 
     1196{ 
     1197        mShowViewCells = !mShowViewCells; 
     1198        mSceneMgr->setOption("ShowViewCells", &mShowViewCells); 
    11871199} 
    11881200//----------------------------------------------------------------------- 
     
    13631375 
    13641376        case KC_C: 
    1365  
    13661377                if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY) 
     1378                { 
    13671379                        mItemBufferMode = GtpVisibility::QueryManager::GEOMETRY_VISIBILITY; 
     1380                } 
    13681381                else 
     1382                { 
    13691383                        mItemBufferMode = GtpVisibility::QueryManager::PATCH_VISIBILITY; 
    1370  
     1384                } 
    13711385                break; 
    13721386 
     
    13781392                break; 
    13791393 
     1394        /////////////// 
    13801395        //-- visualization 
    13811396        case KC_1: 
     
    13961411                toggleRecord(); 
    13971412                break; 
    1398 #if USE_PERFHUD 
     1413//#if USE_PERFHUD 
    13991414        case KC_F1: 
    14001415                toggleShowHelp(); 
     
    14131428                applyObjectType(); 
    14141429                break; 
    1415         #endif 
     1430//#endif 
     1431 
    14161432        case KC_F8: 
    1417                 mApplication->generateScene(500, mCurrentObjectType); 
     1433                {       // generate new objects 
     1434                        const int objNum = 500; 
     1435                        mApplication->generateScene(objNum, mCurrentObjectType); 
     1436                } 
    14181437                break; 
    14191438        case KC_F9: 
     
    14321451        case KC_8: 
    14331452                changeAssumedVisibility(-5); 
    1434         //      changeAssumedVisibility(-500); 
     1453                // changeAssumedVisibility(-500); 
    14351454                break; 
    14361455        case KC_9: 
    1437         //      changeAssumedVisibility(500); 
    14381456                changeAssumedVisibility(5); 
     1457                // changeAssumedVisibility(500); 
    14391458                break; 
    14401459        case KC_LSHIFT: 
     
    14551474        case KC_V: 
    14561475                toggleUseViewCells(); 
     1476                break; 
     1477        case KC_L: 
     1478                toggleShowViewCells(); 
    14571479                break; 
    14581480        case KC_Q: 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h

    r1271 r1604  
    210210        void changeVizScale(const int incr); 
    211211        void setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves); 
    212         /** Shows octree hierarchy of the scene. 
     212        /** Shows visualization of octree hierarchy nodes. 
    213213        */ 
    214214        void toggleShowOctree(); 
     215        /** Shows visualization of the view cells. 
     216        */ 
     217        void toggleShowViewCells(); 
    215218        /** Toggles between view cells / no view cells. 
    216219        */ 
     
    353356        bool mTestGeometryForVisibleLeaves; 
    354357        bool mShowOctree; 
     358        bool mShowViewCells; 
    355359        bool mUseDepthPass; 
    356360        bool mShowVisualization; 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r1593 r1604  
    239239                                 GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING; 
    240240                 } 
     241                 else // default rendering 
     242                 { 
     243                         mAlgorithm =  
     244                                 GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS; 
     245                 } 
    241246        } 
    242247 
     
    289294        mCamNode->attachObject(mCamera); 
    290295         
     296        /////////////////// 
    291297        //-- create visualization camera 
     298 
    292299        mVizCamera = mSceneMgr->createCamera("VizCam"); 
    293300        mVizCamera->setPosition(mCamNode->getPosition()); 
     
    700707                if (rit->movable->getName() != "PlayerCam") 
    701708                { 
    702                         mCamNode->setPosition(mCamNode->getPosition().x, 
     709                        mCamNode->setPosition( 
     710                                mCamNode->getPosition().x, 
    703711                                rit->movable->getWorldBoundingBox().getCenter().y + 2,  
    704712                                mCamNode->getPosition().z); 
    705713         
    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  
    714714                        return true; 
    715715                } 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.h

    r1271 r1604  
    2929{ 
    3030public: 
     31         
    3132        VisualizationRenderTargetListener(SceneManager *sceneMgr); 
    3233 
Note: See TracChangeset for help on using the changeset viewer.