Changeset 86 for trunk/VUT/work/TestCulling/TestCullingApplication.cpp
- Timestamp:
- 05/06/05 01:39:32 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCulling/TestCullingApplication.cpp
r85 r86 54 54 55 55 mSceneContentGenerator = new SceneContentGenerator(mSceneMgr); 56 mSceneContentGenerator->GenerateScene(3 30, "robot.mesh");56 mSceneContentGenerator->GenerateScene(3000, "sphere.mesh"); 57 57 58 58 // Create a skybox … … 101 101 CEGUI::Renderer *renderer, 102 102 SceneContentGenerator *sceneContentGenerator) 103 : ExampleFrameListener(win, cam, false, true), mGUIRenderer(renderer), 104 mShutdownRequested(false) 105 { 106 107 // Setup default variables 108 //mOgreHead = NULL; 109 mLMouseDown = false; 110 mRMouseDown = false; 111 mSceneMgr = sceneManager; 112 113 mSceneContentGenerator = sceneContentGenerator; 114 103 : ExampleFrameListener(win, cam, false, true), 104 mSceneMgr(sceneManager), 105 mGUIRenderer(renderer), 106 mShutdownRequested(false), 107 mUseOptimization(false), 108 mLMouseDown(false), 109 mRMouseDown(false), 110 mSceneContentGenerator(sceneContentGenerator), 111 mVisibilityThreshold(0), 112 mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 113 { 115 114 // Reduce move speed 116 115 mMoveSpeed = 50; 117 116 mRotateSpeed *= 2; 118 119 mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 120 mVisibilityThreshold = 0; 121 117 122 118 // Register this so that we get mouse events. 123 119 mEventProcessor->addMouseListener(this); … … 137 133 mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 138 134 mNumObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/NumObjectsInfo"); 135 mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo"); 139 136 140 137 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); … … 146 143 mRenderedNodesInfo->setCaption(": 0"); 147 144 mNumObjectsInfo->setCaption(": 0"); 145 mUseOptimizationInfo->setCaption(": true"); 148 146 149 147 setAlgorithm(mCurrentAlgorithm); 148 toggleUseOptimization(); 150 149 151 150 pOver->show(); … … 226 225 KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 227 226 KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 227 KEY_PRESSED(KC_O, 0.3, toggleUseOptimization()); 228 228 //KEY_PRESSED(KC_T, 1, change); 229 229 … … 250 250 251 251 setAlgorithm(mCurrentAlgorithm); 252 } 253 //----------------------------------------------------------------------- 254 void MouseQueryListener::toggleUseOptimization() 255 { 256 mUseOptimization = !mUseOptimization; 257 258 mSceneMgr->setOption("UseOptimization", &mUseOptimization); 259 260 if(mUseOptimization) 261 mUseOptimizationInfo->setCaption(": true"); 262 else 263 mUseOptimizationInfo->setCaption(": false"); 264 } 265 //----------------------------------------------------------------------- 266 void MouseQueryListener::toggleShowOctree() 267 { 268 mShowOctree = !mShowOctree; 269 270 mSceneMgr->setOption("ShowOctree", &mShowOctree); 252 271 } 253 272 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.