Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 85)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 86)
@@ -96,5 +96,8 @@
 
 	mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr);
+	
+	mTerrainContentGenerator->GenerateScene(500, "ninja.mesh");
 	mTerrainContentGenerator->GenerateScene(500, "robot.mesh");
+
 	// no limitations needed anymore: the user can set 
 	// objects also on peaks of terrain
@@ -137,20 +140,19 @@
 									   CEGUI::Renderer *renderer,
 									   TerrainContentGenerator *sceneGenerator): 
-ExampleFrameListener(win, cam, false, true), mGUIRenderer(renderer), 
-mShutdownRequested(false)
-{
-	// Setup default variables
-	mCurrentObject = NULL;
-	mLMouseDown = false;
-	mRMouseDown = false;
-	mSceneMgr = sceneManager;
-	mTerrainContentGenerator = sceneGenerator;
-
-    // Reduce move speed
+ExampleFrameListener(win, cam, false, true), 
+mGUIRenderer(renderer), 
+mShutdownRequested(false), 
+mUseOptimization(false),
+mLMouseDown(false),
+mRMouseDown(false),
+mSceneMgr(sceneManager),
+mCurrentObject(NULL),
+mTerrainContentGenerator(sceneGenerator),
+mVisibilityThreshold(0),
+mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING)
+{
+	// Reduce move speed
 	mMoveSpeed = 50;
 	mRotateSpeed *= 2;
-
-	mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING;
-	mVisibilityThreshold = 0;
     
 	// Register this so that we get mouse events.
@@ -173,4 +175,5 @@
 	mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo");
 	mNumObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/NumObjectsInfo");
+	mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo");
 
 	mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
@@ -182,6 +185,9 @@
 	mRenderedNodesInfo->setCaption(": 0");
 	mNumObjectsInfo->setCaption(": 0");
+	mUseOptimizationInfo->setCaption(": true");
 
 	setAlgorithm(mCurrentAlgorithm);
+	toggleUseOptimization();
+	toggleShowOctree();
 
     pOver->show();
@@ -293,4 +299,6 @@
 	KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10));
 	KEY_PRESSED(KC_ADD, 0, changeThreshold(10));
+	KEY_PRESSED(KC_O, 0.3, toggleUseOptimization());
+	KEY_PRESSED(KC_S, 0.3, toggleShowOctree());
 	//KEY_PRESSED(KC_T, 1, change);
       
@@ -321,4 +329,5 @@
 void MouseQueryListener::setAlgorithm(int algorithm)
 {
+	//OutputDebugString("changing algorithm\n");
 	mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
 	mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm);
@@ -347,4 +356,23 @@
 	sprintf(str,": %d", mTerrainContentGenerator->GetObjectCount()); 
 	mNumObjectsInfo->setCaption(str);
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::toggleUseOptimization()
+{
+	mUseOptimization = !mUseOptimization;
+
+	mSceneMgr->setOption("UseOptimization", &mUseOptimization);
+
+	if(mUseOptimization)
+		mUseOptimizationInfo->setCaption(": true");
+	else
+		mUseOptimizationInfo->setCaption(": false");
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::toggleShowOctree()
+{
+	mShowOctree = !mShowOctree;
+
+	mSceneMgr->setOption("ShowOctree", &mShowOctree);
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h	(revision 85)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h	(revision 86)
@@ -63,4 +63,6 @@
 	void changeThreshold(int incr);
 	void changeStats();
+	void toggleUseOptimization();
+	void toggleShowOctree();
 
 protected:
@@ -80,5 +82,5 @@
     OverlayElement *mTraversedNodesInfo;
 	OverlayElement *mHierarchyNodesInfo;
-	//OverlayElement *mSceneNodesInfo;
+	OverlayElement *mUseOptimizationInfo;
 	OverlayElement *mRenderedNodesInfo;
 	OverlayElement *mNumObjectsInfo;
@@ -89,4 +91,7 @@
 	RayQueryExecutor *mRayQueryExecutor;
 	TerrainContentGenerator *mTerrainContentGenerator;
+
+	bool mUseOptimization;
+	bool mShowOctree;
 };
 
Index: trunk/VUT/work/TestCulling/SceneContentGenerator.cpp
===================================================================
--- trunk/VUT/work/TestCulling/SceneContentGenerator.cpp	(revision 85)
+++ trunk/VUT/work/TestCulling/SceneContentGenerator.cpp	(revision 86)
@@ -20,5 +20,6 @@
 mMaxPos(Vector3(70.0f, 70.0f, 600.0f)), 
 mMinAngle(Vector3(0.0f, 0.0f, 0.0f)),
-mMaxAngle(Vector3(360, 360, 360))
+mMaxAngle(Vector3(360, 360, 360)),
+mScale(0.05, 0.05, 0.05)
 {
 }
@@ -67,5 +68,5 @@
 
 	currentObject->attachObject(ent);
-	currentObject->setScale(0.1f, 0.1f, 0.1f);
+	currentObject->setScale(mScale);
 		
 	currentObject->yaw(Degree(rotation.x));
@@ -106,3 +107,8 @@
 	return mCount;
 }
+//-----------------------------------------------------------------------
+void SceneContentGenerator::SetScale(Vector3 scale)
+{
+	mScale = scale;
+}
 } // namespace Ogre
Index: trunk/VUT/work/TestCulling/TestCullingApplication.cpp
===================================================================
--- trunk/VUT/work/TestCulling/TestCullingApplication.cpp	(revision 85)
+++ trunk/VUT/work/TestCulling/TestCullingApplication.cpp	(revision 86)
@@ -54,5 +54,5 @@
 
 	mSceneContentGenerator = new SceneContentGenerator(mSceneMgr);
-	mSceneContentGenerator->GenerateScene(330, "robot.mesh");
+	mSceneContentGenerator->GenerateScene(3000, "sphere.mesh");
 
 	// Create a skybox
@@ -101,23 +101,19 @@
 									   CEGUI::Renderer *renderer,
 									   SceneContentGenerator *sceneContentGenerator)
-        : ExampleFrameListener(win, cam, false, true), mGUIRenderer(renderer), 
-		mShutdownRequested(false)
-{
-
-	// Setup default variables
-	//mOgreHead = NULL;
-	mLMouseDown = false;
-	mRMouseDown = false;
-	mSceneMgr = sceneManager;
-
-	mSceneContentGenerator = sceneContentGenerator;
-
+: ExampleFrameListener(win, cam, false, true),
+mSceneMgr(sceneManager),
+mGUIRenderer(renderer), 
+mShutdownRequested(false), 
+mUseOptimization(false),
+mLMouseDown(false),
+mRMouseDown(false),
+mSceneContentGenerator(sceneContentGenerator),
+mVisibilityThreshold(0),
+mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING)
+{
     // Reduce move speed
 	mMoveSpeed = 50;
 	mRotateSpeed *= 2;
-
-	mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING;
-	mVisibilityThreshold = 0;
-    
+ 
 	// Register this so that we get mouse events.
 	mEventProcessor->addMouseListener(this);
@@ -137,4 +133,5 @@
 	mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo");
 	mNumObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/NumObjectsInfo");
+	mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo");
 
 	mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
@@ -146,6 +143,8 @@
 	mRenderedNodesInfo->setCaption(": 0");
 	mNumObjectsInfo->setCaption(": 0");
+	mUseOptimizationInfo->setCaption(": true");
 
 	setAlgorithm(mCurrentAlgorithm);
+	toggleUseOptimization();
 
     pOver->show();
@@ -226,4 +225,5 @@
 	KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10));
 	KEY_PRESSED(KC_ADD, 0, changeThreshold(10));
+	KEY_PRESSED(KC_O, 0.3, toggleUseOptimization());
 	//KEY_PRESSED(KC_T, 1, change);
       
@@ -250,4 +250,23 @@
 
 	setAlgorithm(mCurrentAlgorithm);
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::toggleUseOptimization()
+{
+	mUseOptimization = !mUseOptimization;
+
+	mSceneMgr->setOption("UseOptimization", &mUseOptimization);
+
+	if(mUseOptimization)
+		mUseOptimizationInfo->setCaption(": true");
+	else
+		mUseOptimizationInfo->setCaption(": false");
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::toggleShowOctree()
+{
+	mShowOctree = !mShowOctree;
+
+	mSceneMgr->setOption("ShowOctree", &mShowOctree);
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/work/TestCulling/SceneContentGenerator.h
===================================================================
--- trunk/VUT/work/TestCulling/SceneContentGenerator.h	(revision 85)
+++ trunk/VUT/work/TestCulling/SceneContentGenerator.h	(revision 86)
@@ -35,4 +35,5 @@
 	void SetMaxPos(Vector3 maxPos);
 	int GetObjectCount();
+	void SetScale(Vector3 scale);
 
 protected:
@@ -42,5 +43,6 @@
 	Vector3 mMaxPos;
 	Vector3 mMinPos;
-	
+	Vector3 mScale;
+
 	SceneManager *mSceneMgr;
 	int mCount;		// The number of objects on the screen
Index: trunk/VUT/work/TestCulling/TestCullingApplication.h
===================================================================
--- trunk/VUT/work/TestCulling/TestCullingApplication.h	(revision 85)
+++ trunk/VUT/work/TestCulling/TestCullingApplication.h	(revision 86)
@@ -64,4 +64,6 @@
 	void changeThreshold(int incr);
 	void changeStats();
+	void toggleUseOptimization();
+	void toggleShowOctree();
 
 protected:
@@ -83,6 +85,10 @@
 	OverlayElement *mRenderedNodesInfo;
 	OverlayElement *mNumObjectsInfo;
+	OverlayElement *mUseOptimizationInfo;
 
 	SceneContentGenerator *mSceneContentGenerator;
+
+	bool mUseOptimization;
+	bool mShowOctree;
 };
 
