Changeset 87 for trunk/VUT/work
- Timestamp:
- 05/09/05 01:24:02 (20 years ago)
- Location:
- trunk/VUT/work
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCulling/SceneContentGenerator.cpp
r86 r87 21 21 mMinAngle(Vector3(0.0f, 0.0f, 0.0f)), 22 22 mMaxAngle(Vector3(360, 360, 360)), 23 mScale(0. 05, 0.05, 0.05)23 mScale(0.1, 0.1, 0.1) 24 24 { 25 25 } -
trunk/VUT/work/TestCulling/TestCullingApplication.cpp
r86 r87 110 110 mSceneContentGenerator(sceneContentGenerator), 111 111 mVisibilityThreshold(0), 112 mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 112 mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING), 113 mShowOctree(true), 114 mUseCulling(false) 113 115 { 114 116 // Reduce move speed … … 132 134 mHierarchyNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/HierarchyNodesInfo"); 133 135 mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 134 m NumObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/NumObjectsInfo");136 mObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ObjectsInfo"); 135 137 mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo"); 138 mQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueriesIssuedInfo"); 136 139 137 140 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); … … 142 145 mHierarchyNodesInfo->setCaption(": 0"); 143 146 mRenderedNodesInfo->setCaption(": 0"); 144 m NumObjectsInfo->setCaption(": 0");147 mObjectsInfo->setCaption(": 0"); 145 148 mUseOptimizationInfo->setCaption(": true"); 149 mQueriesIssuedInfo->setCaption(": 0"); 146 150 147 151 setAlgorithm(mCurrentAlgorithm); … … 226 230 KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 227 231 KEY_PRESSED(KC_O, 0.3, toggleUseOptimization()); 228 //KEY_PRESSED(KC_T, 1, change);229 230 changeStats();232 KEY_PRESSED(KC_C, 0.3, toggleUseCulling()); 233 234 updateStats(); 231 235 232 236 return ExampleFrameListener::frameStarted(evt) && ExampleFrameListener::frameEnded(evt); … … 271 275 } 272 276 //----------------------------------------------------------------------- 277 void MouseQueryListener::toggleUseCulling() 278 { 279 mUseCulling = !mUseCulling; 280 281 mSceneMgr->setOption("UseCulling", &mUseCulling); 282 } 283 //----------------------------------------------------------------------- 273 284 void MouseQueryListener::setAlgorithm(int algorithm) 274 285 { … … 277 288 } 278 289 //----------------------------------------------------------------------- 279 void MouseQueryListener:: changeStats()290 void MouseQueryListener::updateStats() 280 291 { 281 292 unsigned int opt = 0; … … 285 296 mFrustumCulledNodesInfo->setCaption(str); 286 297 298 mSceneMgr->getOption("NumQueriesIssued", &opt); sprintf(str,": %d", opt); 299 mQueriesIssuedInfo->setCaption(str); 300 287 301 mSceneMgr->getOption("NumQueryCulledNodes", &opt); sprintf(str,": %d", opt); 288 302 mQueryCulledNodesInfo->setCaption(str); … … 298 312 299 313 sprintf(str,": %d", mSceneContentGenerator->GetObjectCount()); 300 m NumObjectsInfo->setCaption(str);314 mObjectsInfo->setCaption(str); 301 315 } 302 316 //----------------------------------------------------------------------- -
trunk/VUT/work/TestCulling/TestCullingApplication.h
r86 r87 63 63 void setAlgorithm(int algorithm); 64 64 void changeThreshold(int incr); 65 void changeStats();65 void updateStats(); 66 66 void toggleUseOptimization(); 67 67 void toggleShowOctree(); 68 void toggleUseCulling(); 68 69 69 70 protected: … … 84 85 OverlayElement *mHierarchyNodesInfo; 85 86 OverlayElement *mRenderedNodesInfo; 86 OverlayElement *m NumObjectsInfo;87 OverlayElement *mObjectsInfo; 87 88 OverlayElement *mUseOptimizationInfo; 89 OverlayElement *mQueriesIssuedInfo; 88 90 89 91 SceneContentGenerator *mSceneContentGenerator; … … 91 93 bool mUseOptimization; 92 94 bool mShowOctree; 95 bool mUseCulling; 93 96 }; 94 97 -
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.