- Timestamp:
- 05/04/05 17:58:13 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r84 r85 86 86 87 87 // Set a nice viewpoint 88 mCamera->setPosition(707, 2500,528);88 mCamera->setPosition(707, 2500, 528); 89 89 mCamera->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329)); 90 90 … … 96 96 97 97 mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 98 mTerrainContentGenerator->GenerateScene( 300, "robot.mesh");98 mTerrainContentGenerator->GenerateScene(500, "robot.mesh"); 99 99 // no limitations needed anymore: the user can set 100 100 // objects also on peaks of terrain … … 151 151 mRotateSpeed *= 2; 152 152 153 mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING ,154 m Threshold = 0;153 mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 154 mVisibilityThreshold = 0; 155 155 156 156 // Register this so that we get mouse events. … … 182 182 mRenderedNodesInfo->setCaption(": 0"); 183 183 mNumObjectsInfo->setCaption(": 0"); 184 185 setAlgorithm(mCurrentAlgorithm); 184 186 185 187 pOver->show(); … … 287 289 timeDelay -= evt.timeSinceLastFrame; 288 290 289 KEY_PRESSED(KC_SPACE, 0.3, changeAlgorithm());291 KEY_PRESSED(KC_SPACE, 0.3, nextAlgorithm()); 290 292 291 293 KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); … … 300 302 void MouseQueryListener::changeThreshold(int incr) 301 303 { 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); 307 310 mThresholdInfo->setCaption(str); 308 311 } 309 312 //----------------------------------------------------------------------- 310 void MouseQueryListener:: changeAlgorithm()313 void MouseQueryListener::nextAlgorithm() 311 314 { 312 315 mCurrentAlgorithm = ++mCurrentAlgorithm % 313 316 GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS, 314 317 318 setAlgorithm(mCurrentAlgorithm); 319 } 320 //----------------------------------------------------------------------- 321 void MouseQueryListener::setAlgorithm(int algorithm) 322 { 315 323 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 316 324 mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm);
Note: See TracChangeset
for help on using the changeset viewer.