Ignore:
Timestamp:
05/04/05 17:58:13 (19 years ago)
Author:
mattausch
Message:

corrected bug so chc is much faster than stop and wait

Location:
trunk/VUT/work/TestCullingTerrain
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp

    r84 r85  
    5353{ 
    5454        mMinPos = Vector3(0.0f, 5000.0f, 0.0f); 
    55         mMaxPos = Vector3(1000.0f, 5000.0f, 1000.0f); 
     55        mMaxPos = Vector3(3000.0f, 5000.0f, 3000.0f); 
    5656 
    5757        mMinAngle = Vector3(0.0f, 0.0f, 0.0f); 
     
    8787        mMaxHeight = maxHeight; 
    8888} 
    89 //----------------------------------------------------------------------- 
    90 int TerrainContentGenerator::GetObjectCount() 
    91 { 
    92         return mCount; 
    93 } 
    9489 
    9590} // namespace Ogre 
  • trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.h

    r84 r85  
    3434 
    3535        void SetMaxHeight(Real maxHeight); 
    36         int GetObjectCount(); 
    37  
     36         
    3837protected: 
    3938        RayQueryExecutor *mRayQueryExecutor; 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r84 r85  
    8686 
    8787        // Set a nice viewpoint 
    88         mCamera->setPosition(707,2500,528); 
     88        mCamera->setPosition(707, 2500, 528); 
    8989        mCamera->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329)); 
    9090         
     
    9696 
    9797        mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 
    98         mTerrainContentGenerator->GenerateScene(300, "robot.mesh"); 
     98        mTerrainContentGenerator->GenerateScene(500, "robot.mesh"); 
    9999        // no limitations needed anymore: the user can set  
    100100        // objects also on peaks of terrain 
     
    151151        mRotateSpeed *= 2; 
    152152 
    153         mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING, 
    154         mThreshold = 0; 
     153        mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 
     154        mVisibilityThreshold = 0; 
    155155     
    156156        // Register this so that we get mouse events. 
     
    182182        mRenderedNodesInfo->setCaption(": 0"); 
    183183        mNumObjectsInfo->setCaption(": 0"); 
     184 
     185        setAlgorithm(mCurrentAlgorithm); 
    184186 
    185187    pOver->show(); 
     
    287289        timeDelay -= evt.timeSinceLastFrame; 
    288290 
    289     KEY_PRESSED(KC_SPACE, 0.3, changeAlgorithm()); 
     291    KEY_PRESSED(KC_SPACE, 0.3, nextAlgorithm()); 
    290292 
    291293        KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 
     
    300302void MouseQueryListener::changeThreshold(int incr) 
    301303{ 
    302         mThreshold += incr; if(mThreshold < 0) mThreshold = 0; 
    303          
    304         char str[100]; sprintf(str,": %d", mThreshold); 
    305  
    306         mSceneMgr->setOption("Threshold", &mThreshold);  
     304        mVisibilityThreshold += incr;  
     305        if(mVisibilityThreshold < 0) mVisibilityThreshold = 0; 
     306         
     307        char str[100]; sprintf(str,": %d", mVisibilityThreshold); 
     308 
     309        mSceneMgr->setOption("Threshold", &mVisibilityThreshold);  
    307310        mThresholdInfo->setCaption(str); 
    308311} 
    309312//----------------------------------------------------------------------- 
    310 void MouseQueryListener::changeAlgorithm() 
     313void MouseQueryListener::nextAlgorithm() 
    311314{ 
    312315        mCurrentAlgorithm = ++mCurrentAlgorithm %  
    313316                GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS, 
    314317 
     318        setAlgorithm(mCurrentAlgorithm); 
     319} 
     320//----------------------------------------------------------------------- 
     321void MouseQueryListener::setAlgorithm(int algorithm) 
     322{ 
    315323        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
    316324        mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm); 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h

    r84 r85  
    5959        void keyClicked(KeyEvent* e); 
    6060 
    61         void changeAlgorithm(); 
     61        void nextAlgorithm(); 
     62        void setAlgorithm(int algorithm); 
    6263        void changeThreshold(int incr); 
    6364        void changeStats(); 
     
    7172        bool mShutdownRequested; 
    7273        int mCurrentAlgorithm; 
    73         int mThreshold; 
     74        int mVisibilityThreshold; 
    7475 
    7576        OverlayElement *mAlgorithmInfo; 
     
    9798 
    9899protected: 
    99         void createScene(void); 
    100         void createFrameListener(void); 
    101         void setupGui(void); 
    102         virtual void createCamera(void); 
     100        void createScene(); 
     101        void createFrameListener(); 
     102        void setupGui(); 
     103        virtual void createCamera(); 
    103104 
    104105        CEGUI::OgreCEGUIRenderer *mGUIRenderer; 
Note: See TracChangeset for help on using the changeset viewer.