Changeset 113 for trunk/VUT/work
- Timestamp:
- 05/27/05 11:56:51 (20 years ago)
- Location:
- trunk/VUT/work/TestCullingTerrain
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r112 r113 92 92 { 93 93 // Set ambient light 94 //mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));95 94 mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 96 95 97 96 //-- create light 98 97 mSunLight = mSceneMgr->createLight("SunLight"); … … 104 103 mSunLight->setCastShadows(true); 105 104 106 Vector3 dir(0.5, 0.5, 0.5);105 Vector3 dir(0.5, 1, 0.5); 107 106 dir.normalise(); 108 107 mSunLight->setDirection(dir); … … 237 236 mVizCamera(vizCamera), 238 237 mShowVisualization(false), 239 m RenderNodesForViz(false),238 mNodeVizMode(NODEVIZ_NONE), 240 239 mVizCameraHeight(Real(2500.0)), 241 240 mCamNode(camNode), … … 292 291 mSceneMgr->setOption("CullCamera", &mCullCamera); 293 292 mSceneMgr->setOption("ShowVisualization", &mShowVisualization); 294 mSceneMgr->setOption("RenderNodesForViz", &mRenderNodesForViz); 295 293 296 294 pOver->show(); 297 295 } … … 403 401 // important for visualization => draw octree bounding boxes 404 402 mSceneMgr->setOption("ShowOctree", &mShowVisualization); 405 // also render geometry?406 mSceneMgr->setOption("RenderNodesForViz", &mRenderNodesForViz);403 // also render nodew content? 404 //mSceneMgr->setOption("RenderNodesForViz", &mRenderNodesForViz); 407 405 408 406 // -- setup visualization camera … … 454 452 KEY_PRESSED(KC_C, 0.3, toggleUseVisibilityCulling()); 455 453 KEY_PRESSED(KC_1, 0.3, toggleShowViz()); 456 KEY_PRESSED(KC_2, 0.3, toggleRenderNodesForViz());454 KEY_PRESSED(KC_2, 0.3, nextNodeVizMode()); 457 455 458 456 KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 459 457 KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 460 458 461 KEY_PRESSED(KC_ 3, 0, zoomVizCamera(50));462 KEY_PRESSED(KC_ 4, 0, zoomVizCamera(-50));459 KEY_PRESSED(KC_4, 0, zoomVizCamera(50)); 460 KEY_PRESSED(KC_5, 0, zoomVizCamera(-50)); 463 461 464 462 KEY_PRESSED(KC_F1, 0.3, nextAppState()); … … 758 756 } 759 757 //----------------------------------------------------------------------- 760 void MouseQueryListener::toggleRenderNodesForViz() 761 { 762 mRenderNodesForViz = !mRenderNodesForViz; 763 764 mSceneMgr->setOption("RenderNodesForViz", &mRenderNodesForViz); 758 void MouseQueryListener::nextNodeVizMode() 759 { 760 mNodeVizMode = (mNodeVizMode + 1) % NODEVIZ_MODES_NUM; 761 762 bool renderNodesForViz = 763 (mNodeVizMode == NODEVIZ_RENDER_NODES) || 764 (mNodeVizMode == NODEVIZ_RENDER_NODES_AND_CONTENT); 765 bool renderNodesContentForViz = mNodeVizMode == NODEVIZ_RENDER_NODES_AND_CONTENT; 766 767 mSceneMgr->setOption("RenderNodesForViz", &renderNodesForViz); 768 mSceneMgr->setOption("RenderNodesContentForViz", &renderNodesContentForViz); 765 769 } 766 770 //----------------------------------------------------------------------- … … 848 852 const bool nShowViz = !showViz; 849 853 854 // ambient light must be full for visualization 855 if (showViz) 856 { 857 mSceneMgr->setAmbientLight(ColourValue(1, 1, 1)); 858 } 859 else 860 { 861 mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 862 } 863 850 864 mSceneMgr->setOption("ShowVisualization", &showViz); 851 865 mSceneMgr->setOption("SkyBoxEnabled", &nShowViz); -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
r112 r113 87 87 enum {WALKTHROUGH, REPLAY, STATE_NUM}; 88 88 89 // visualization modes for scene nodes 90 enum {NODEVIZ_NONE, NODEVIZ_RENDER_NODES, 91 NODEVIZ_RENDER_NODES_AND_CONTENT, NODEVIZ_MODES_NUM}; 92 89 93 void nextAlgorithm(); 90 94 void changeThreshold(int incr); … … 95 99 void toggleUseVisibilityCulling(); 96 100 void toggleShowViz(); 97 void toggleRenderNodesForViz();101 void nextNodeVizMode(); 98 102 void toggleRecord(); 99 103 … … 148 152 bool mUseVisibilityCulling; 149 153 bool mShowVisualization; 150 bool mRenderNodesForViz;154 int mNodeVizMode; 151 155 bool mCullCamera; 152 156
Note: See TracChangeset
for help on using the changeset viewer.