- Timestamp:
- 06/20/05 08:13:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r137 r139 75 75 mCullCamera(false), 76 76 mRecord(false), 77 m UseShadows(false),77 mShowShadows(false), 78 78 mShowHelp(false), 79 79 mDisplayCameraDetails(false), … … 159 159 mSceneMgr->setOption("ShowOctree", &mShowOctree); 160 160 mSceneMgr->setOption("CullCamera", &mCullCamera); 161 mSceneMgr->setOption(" ShowVisualization", &mShowVisualization);161 mSceneMgr->setOption("PrepareVisualization", &mShowVisualization); 162 162 163 163 // TODO: change this (does not work with other scene manager plugins) … … 257 257 } 258 258 259 // mInputDevice->capture(); 259 if (mDisplayCameraDetails) 260 { 261 // Print camera details 262 mWindow->setDebugText("P: " + StringConverter::toString(mCamera->getDerivedPosition()) + 263 " " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation())); 264 } 260 265 261 266 //-- IMPORTANT: must be set, otherwise terrain is not rendered correctly … … 706 711 void TerrainFrameListener::toggleShowViz() 707 712 { 708 mShowVisualization = !mShowVisualization; 709 mVisualizeCulledNodes = !mVisualizeCulledNodes; 710 713 mVisualizeCulledNodes = mShowVisualization = !mShowVisualization; 714 711 715 // create viewport with priority VIZ_VIEWPORT_Z_ORDER: 712 716 // will be rendered over standard viewport … … 721 725 // Alter the camera aspect ratio to match the viewport 722 726 mVizCamera->setAspectRatio(Real(vizvp->getActualWidth()) / 723 Real(vizvp->getActualHeight()));727 Real(vizvp->getActualHeight())); 724 728 725 729 mSceneMgr->setOption("VisualizeCulledNodes", &mVisualizeCulledNodes); … … 733 737 mSceneMgr->setSkyPlane(true, plane, "Examples/TransparentTest", 4000, 75, false); 734 738 */ 735 736 739 } 737 740 else 738 741 { 742 // remove visualization viewport 739 743 mWindow->removeViewport(VIZ_VIEWPORT_Z_ORDER); 740 // if octree was enabled for visualization purpose, reset now 744 745 // octree bounding boxes are shown for visualization purpose, reset now 741 746 mSceneMgr->setOption("ShowOctree", &mShowOctree); 742 747 } 743 748 } 744 749 //----------------------------------------------------------------------- 745 void TerrainFrameListener::toggle UseShadows()746 { 747 m UseShadows = !mUseShadows;748 749 mSunLight->setCastShadows(m UseShadows);750 751 if (m UseShadows)750 void TerrainFrameListener::toggleShowShadows() 751 { 752 mShowShadows = !mShowShadows; 753 754 mSunLight->setCastShadows(mShowShadows); 755 756 if (mShowShadows) 752 757 { 753 758 mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE); 759 //mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE); 760 //mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE); 754 761 } 755 762 else … … 805 812 break; 806 813 case KC_S: 807 toggle UseShadows();814 toggleShowShadows(); 808 815 break; 809 816 … … 857 864 break; 858 865 } 859 860 if (mDisplayCameraDetails)861 {862 // Print camera details863 mWindow->setDebugText("P: " + StringConverter::toString(mCamera->getDerivedPosition()) +864 " " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation()));865 }866 866 867 867 CEGUI::System::getSingleton().injectKeyDown(e->getKey());
Note: See TracChangeset
for help on using the changeset viewer.