Changeset 87 for trunk/VUT/work/TestCullingTerrain
- Timestamp:
- 05/09/05 01:24:02 (19 years ago)
- Location:
- trunk/VUT/work/TestCullingTerrain
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp
r85 r87 50 50 //----------------------------------------------------------------------- 51 51 TerrainContentGenerator::TerrainContentGenerator(SceneManager *sm): 52 SceneContentGenerator(sm), mMaxHeight( 100)52 SceneContentGenerator(sm), mMaxHeight(50) 53 53 { 54 54 mMinPos = Vector3(0.0f, 5000.0f, 0.0f); -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r86 r87 96 96 97 97 mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 98 99 mTerrainContentGenerator->GenerateScene(500, "ninja.mesh"); 100 mTerrainContentGenerator->GenerateScene(500, "robot.mesh"); 98 // mTerrainContentGenerator->GenerateScene(500, "ninja.mesh"); 99 mTerrainContentGenerator->GenerateScene(1000, "robot.mesh"); 101 100 102 101 // no limitations needed anymore: the user can set … … 150 149 mTerrainContentGenerator(sceneGenerator), 151 150 mVisibilityThreshold(0), 152 mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 151 mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING), 152 mShowOctree(true), 153 mUseCulling(false) 153 154 { 154 155 // Reduce move speed … … 174 175 mHierarchyNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/HierarchyNodesInfo"); 175 176 mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 176 m NumObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/NumObjectsInfo");177 mObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ObjectsInfo"); 177 178 mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo"); 178 179 mQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueriesIssuedInfo"); 180 179 181 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 180 182 mThresholdInfo->setCaption(": 0"); … … 184 186 mHierarchyNodesInfo->setCaption(": 0"); 185 187 mRenderedNodesInfo->setCaption(": 0"); 186 m NumObjectsInfo->setCaption(": 0");188 mObjectsInfo->setCaption(": 0"); 187 189 mUseOptimizationInfo->setCaption(": true"); 190 mQueriesIssuedInfo->setCaption(": 0"); 188 191 189 192 setAlgorithm(mCurrentAlgorithm); 190 193 toggleUseOptimization(); 191 194 toggleShowOctree(); 195 toggleUseCulling(); 192 196 193 197 pOver->show(); … … 301 305 KEY_PRESSED(KC_O, 0.3, toggleUseOptimization()); 302 306 KEY_PRESSED(KC_S, 0.3, toggleShowOctree()); 303 //KEY_PRESSED(KC_T, 1, change);304 305 changeStats();307 KEY_PRESSED(KC_C, 0.3, toggleUseCulling()); 308 309 updateStats(); 306 310 307 311 return ExampleFrameListener::frameStarted(evt) && ExampleFrameListener::frameEnded(evt); … … 329 333 void MouseQueryListener::setAlgorithm(int algorithm) 330 334 { 331 //OutputDebugString("changing algorithm\n");332 335 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 333 336 mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm); 334 337 } 335 338 //----------------------------------------------------------------------- 336 void MouseQueryListener:: changeStats()339 void MouseQueryListener::updateStats() 337 340 { 338 341 unsigned int opt = 0; … … 342 345 mFrustumCulledNodesInfo->setCaption(str); 343 346 347 mSceneMgr->getOption("NumQueriesIssued", &opt); sprintf(str,": %d", opt); 348 mQueriesIssuedInfo->setCaption(str); 349 344 350 mSceneMgr->getOption("NumQueryCulledNodes", &opt); sprintf(str,": %d", opt); 345 351 mQueryCulledNodesInfo->setCaption(str); … … 355 361 356 362 sprintf(str,": %d", mTerrainContentGenerator->GetObjectCount()); 357 m NumObjectsInfo->setCaption(str);363 mObjectsInfo->setCaption(str); 358 364 } 359 365 //----------------------------------------------------------------------- … … 375 381 376 382 mSceneMgr->setOption("ShowOctree", &mShowOctree); 383 } 384 //----------------------------------------------------------------------- 385 void MouseQueryListener::toggleUseCulling() 386 { 387 mUseCulling = !mUseCulling; 388 389 mSceneMgr->setOption("UseCulling", &mUseCulling); 377 390 } 378 391 //----------------------------------------------------------------------- -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
r86 r87 62 62 void setAlgorithm(int algorithm); 63 63 void changeThreshold(int incr); 64 void changeStats();64 void updateStats(); 65 65 void toggleUseOptimization(); 66 66 void toggleShowOctree(); 67 void toggleUseCulling(); 67 68 68 69 protected: … … 84 85 OverlayElement *mUseOptimizationInfo; 85 86 OverlayElement *mRenderedNodesInfo; 86 OverlayElement *mNumObjectsInfo; 87 OverlayElement *mObjectsInfo; 88 OverlayElement *mQueriesIssuedInfo; 87 89 88 90 SceneNode *mCurrentObject; // The newly created object … … 94 96 bool mUseOptimization; 95 97 bool mShowOctree; 98 bool mUseCulling; 96 99 }; 97 100
Note: See TracChangeset
for help on using the changeset viewer.