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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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); 
Note: See TracChangeset for help on using the changeset viewer.