Index: trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj	(revision 29)
+++ trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj	(revision 32)
@@ -34,8 +34,8 @@
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				AdditionalDependencies="OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib"
 				OutputFile="$(OGRE_PATH)/Samples/Common/bin/Debug/TestCulling.exe"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\Debug&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\Debug&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;"
+				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\Debug&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\Debug&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;"
 				GenerateDebugInformation="TRUE"
 				ProgramDatabaseFile="$(OutDir)/TestCulling.pdb"
Index: trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp	(revision 31)
+++ trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp	(revision 32)
@@ -106,5 +106,6 @@
         mRotateSpeed *= 2;
 	
-		mCurrentAlgorithm = OcclusionCullingSceneManager::RENDER_COHERENT;
+		mCurrentAlgorithm = OcclusionCullingSceneTraverser::RENDER_COHERENT;
+		mThreshold = 0;
 
 		// Register this so that we get mouse events.
@@ -121,10 +122,7 @@
 		mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/QueryCulledNodesInfo");
         mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/TraversedNodesInfo");
-		
-		//mMaterialInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/MaterialInfo");
-        //mInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/Info");
-
+	
 		mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
-		mThresholdInfo->setCaption(": dfddfdffdfd0");
+		mThresholdInfo->setCaption(": 0");
 		mFrustumCulledNodesInfo->setCaption(": 0");
 		mQueryCulledNodesInfo->setCaption(": 0");
@@ -191,9 +189,15 @@
 bool MouseQueryListener::frameEnded(const FrameEvent& evt)
 {
+	if (mShutdownRequested)
+		return false;
+
     if (timeDelay >= 0) 
         timeDelay -= evt.timeSinceLastFrame;
 
-    KEY_PRESSED(KC_O, 1, changeAlgorithm());
-	//KEY_PRESSED(KC_T, 1, changeAlgorithm());
+    KEY_PRESSED(KC_SPACE, 0.3, changeAlgorithm());
+
+	KEY_PRESSED(KC_SUBTRACT, 0.3, changeThreshold(-10));
+	KEY_PRESSED(KC_ADD, 0, changeThreshold(10));
+	//KEY_PRESSED(KC_T, 1, change);
       
 	changeStats();
@@ -202,7 +206,17 @@
 }
 //-----------------------------------------------------------------------
+void MouseQueryListener::changeThreshold(int incr)
+{
+	mThreshold += incr; if(mThreshold < 0) mThreshold = 0;
+	
+	char str[100]; sprintf(str,": %d", mThreshold);
+
+	mSceneMgr->setOption("Threshold", &mThreshold); 
+	mThresholdInfo->setCaption(str);
+}
+//-----------------------------------------------------------------------
 void MouseQueryListener::changeAlgorithm()
 {
-    mCurrentAlgorithm = ++mCurrentAlgorithm % OcclusionCullingSceneManager::NUM_RENDERMODES;
+    mCurrentAlgorithm = ++mCurrentAlgorithm % OcclusionCullingSceneTraverser::NUM_RENDERMODES;
 
 	mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
@@ -214,8 +228,39 @@
 	unsigned int opt = 0;
 	char str[100];
-	mSceneMgr->getOption("Threshold", &opt); sprintf(str,"%d",opt);mThresholdInfo->setCaption(str);
-	mSceneMgr->getOption("NumFrustumCulledNodes", &opt); sprintf(str,"%d",opt); mFrustumCulledNodesInfo->setCaption(str);
-	mSceneMgr->getOption("NumQueryCulledNodes", &opt); sprintf(str,"%d",opt);mQueryCulledNodesInfo->setCaption(str);
-	mSceneMgr->getOption("NumTraversedNodes", &opt); sprintf(str,"%d",opt);mTraversedNodesInfo->setCaption(str);
+	
+	mSceneMgr->getOption("NumFrustumCulledNodes", &opt); sprintf(str,": %d", opt); 
+	mFrustumCulledNodesInfo->setCaption(str);
+	
+	mSceneMgr->getOption("NumQueryCulledNodes", &opt); sprintf(str,": %d", opt); 
+	mQueryCulledNodesInfo->setCaption(str);
+	
+	mSceneMgr->getOption("NumTraversedNodes", &opt); sprintf(str,": %d", opt); 
+	mTraversedNodesInfo->setCaption(str);
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::keyPressed(KeyEvent* e)
+{
+	if(e->getKey() == KC_ESCAPE)
+    {
+		mShutdownRequested = true;
+		e->consume();
+		return;
+	}
+
+	CEGUI::System::getSingleton().injectKeyDown(e->getKey());
+	CEGUI::System::getSingleton().injectChar(e->getKeyChar());
+	e->consume();
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::keyReleased(KeyEvent* e)
+{
+	CEGUI::System::getSingleton().injectKeyUp(e->getKey());
+	e->consume();
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::keyClicked(KeyEvent* e) 
+{
+	// Do nothing
+	e->consume();
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h	(revision 30)
+++ trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h	(revision 32)
@@ -6,4 +6,5 @@
 #include "ExampleApplication.h"
 #include "OgreOcclusionCullingSceneManager.h"
+#include "OgreOcclusionCullingSceneTraverser.h"
 
 Real timeDelay = 0;
@@ -17,5 +18,5 @@
 }
 
-String mCurrentAlgorithmCaptions[OcclusionCullingSceneManager::NUM_RENDERMODES] = 
+String mCurrentAlgorithmCaptions[OcclusionCullingSceneTraverser::NUM_RENDERMODES] = 
 {
     "Cull Frustum", 
@@ -53,39 +54,12 @@
     // This is when the mouse is clicked, held and dragged.
     virtual void mouseDragged (MouseEvent *e);
-/*
-    void keyPressed(KeyEvent* e)
-    {
-        if(e->getKey() == KC_ESCAPE)
-        {
-            mShutdownRequested = true;
-            e->consume();
-            return;
-        }
 
-        CEGUI::System::getSingleton().injectKeyDown(e->getKey());
-		CEGUI::System::getSingleton().injectChar(e->getKeyChar());
-        e->consume();
-    }
+    void keyPressed(KeyEvent* e);
 
-	void keyReleased(KeyEvent* e)
-	{
-		CEGUI::System::getSingleton().injectKeyUp(e->getKey());
-		e->consume();
-	}
-	void keyClicked(KeyEvent* e) 
-	{
-		// Do nothing
-		e->consume();
-	}
+	void keyReleased(KeyEvent* e);
+	void keyClicked(KeyEvent* e);
 
-    bool frameEnded(const FrameEvent& evt)
-    {
-        if (mShutdownRequested)
-            return false;
-        else
-            return ExampleFrameListener::frameEnded(evt);
-    }
-*/
 	void changeAlgorithm();
+	void changeThreshold(int incr);
 	void changeStats();
 
@@ -96,7 +70,8 @@
     CEGUI::Renderer *mGUIRenderer;     // cegui renderer
 	SceneNode* mShipNode;
-//	bool mShutdownRequested;
+	bool mShutdownRequested;
 	int mCurrentAlgorithm;
-	
+	int mThreshold;
+
 	OverlayElement *mAlgorithmInfo;
 	OverlayElement *mThresholdInfo;
@@ -113,5 +88,4 @@
     /*TestCullingApplication()
     {
-
     }*/
 
@@ -148,7 +122,4 @@
 
     }*/
-    
-
-	
 };
 
