Index: trunk/VUT/work/TestCullingTerrain/IoManager.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/IoManager.cpp	(revision 104)
+++ trunk/VUT/work/TestCullingTerrain/IoManager.cpp	(revision 104)
@@ -0,0 +1,31 @@
+#include "IoManager.h"
+
+IoManager::IoManager(Ogre::String fileName)
+{
+	mFile.open(fileName.c_str());
+}
+
+IoManager::~IoManager()
+{
+	 mFile.close();
+}
+
+void IoManager::Write()
+{
+	std::vector<Ogre::Vector3>::const_iterator posit, posit_end;
+    posit_end = mPositions.end();
+	
+	std::vector<Ogre::Quaternion>::const_iterator orit;
+	orit = mOrientations.begin();
+
+    for (posit = mPositions.begin(); posit != posit_end; ++posit)
+	{
+		mFile << (*posit) << (*(orit++));
+	}
+}
+
+void IoManager::AddNode(SceneNode *node)
+{
+	mPositions.push_back(node->getPosition());
+	mOrientations.push_back(node->getOrientation());
+}
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj	(revision 100)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj	(revision 104)
@@ -122,4 +122,7 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
 			<File
+				RelativePath=".\IoManager.cpp">
+			</File>
+			<File
 				RelativePath="..\TestCulling\SceneContentGenerator.cpp">
 			</File>
@@ -136,4 +139,7 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
 			<File
+				RelativePath=".\IoManager.h">
+			</File>
+			<File
 				RelativePath="..\TestCulling\SceneContentGenerator.h">
 			</File>
Index: trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp	(revision 97)
+++ trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp	(revision 104)
@@ -82,4 +82,9 @@
 }
 //-----------------------------------------------------------------------
+RayQueryExecutor *TerrainContentGenerator::GetRayQueryExecutor()
+{
+	return mRayQueryExecutor;
+}
+//-----------------------------------------------------------------------
 void TerrainContentGenerator::SetMaxHeight(Real maxHeight)
 {
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 103)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 104)
@@ -68,6 +68,6 @@
 	else
 	{
-		 mVizCamera->setFarClipDistance(1000);
-		 mCamera->setFarClipDistance(1000);
+		 mVizCamera->setFarClipDistance(20000);
+		 mCamera->setFarClipDistance(20000);
 	}	
 }
@@ -191,5 +191,7 @@
 mVizCameraHeight(Real(2500.0)),
 mCamNode(camNode),
-mCullCamera(false)
+mCullCamera(false),
+mDirection(Vector3::ZERO),
+mDistance(0)
 {
 	// Reduce move speed
@@ -238,4 +240,14 @@
 	mSceneMgr->setOption("ShowVisualization", &mShowVisualization);
 	mSceneMgr->setOption("RenderNodesForViz", &mRenderNodesForViz);
+
+	// Create the walking list
+	Vector3 queryResult;
+
+	mWalkList.push_back(Vector3(1550.0f, 5000.0f, 250.0f));
+	mWalkList.push_back(Vector3(100.0f, 5000.0f, 750.0f));
+
+	mTerrainContentGenerator->GenerateSceneObject(mCamera->getPosition(), Vector3::ZERO, "knot.mesh");
+	mTerrainContentGenerator->GenerateSceneObject(Vector3(1550.0f, 5000.0f, 250.0f), Vector3::ZERO, "knot.mesh");
+	mTerrainContentGenerator->GenerateSceneObject(Vector3(100.0f, 5000.0f, 750.0f), Vector3::ZERO, "knot.mesh");
 
 	pOver->show();
@@ -322,7 +334,54 @@
 }
 //-----------------------------------------------------------------------
+bool MouseQueryListener::NextLocation()
+{
+	if (mWalkList.empty())
+	{
+		return false;
+	}
+
+	mDestination = mWalkList.front();  // this gets the front of the deque
+	mWalkList.pop_front();             // this removes the front of the deque
+ 
+	mDirection = mDestination - mCamNode->getPosition();
+	mDistance = mDirection.normalise();
+ 
+	// change facing
+	Vector3 src = mCamNode->getOrientation() * Vector3::UNIT_X;
+
+	if ((1.0f + src.dotProduct(mDirection)) < 0.0001f)
+	{
+		mCamNode->yaw(Degree(180));
+	}
+	else
+	{
+		Ogre::Quaternion quat = src.getRotationTo(mDirection);
+		mCamNode->rotate(quat);
+	}
+
+	return true;
+}
+//-----------------------------------------------------------------------
 bool MouseQueryListener::frameStarted(const FrameEvent &evt)
 {
-	clamp2Terrain();
+	if (mDirection != Vector3::ZERO)
+	{
+		Real move = mWalkSpeed * evt.timeSinceLastFrame;
+		mDistance -= move;
+ 
+		// If we are very close, just jump to the point
+		if (mDistance <= 0.0f)
+		{
+			mCamNode->setPosition(mDestination);
+			mDirection = Vector3::ZERO;
+		} 
+		// Otherwise, move some some
+		else
+		{
+			mCamNode->translate(mDirection * move);
+		}
+	} 
+
+	Clamp2Terrain();
 
 	if (mShowVisualization)
@@ -346,4 +405,6 @@
 		mVizCamera->yaw(Math::ATan2(-mCamera->getDerivedDirection().x, 
 			-mCamera->getDerivedDirection().z));
+		
+		mVizCamera->moveRelative(Vector3(0, 800, 0));
 	}
 
@@ -351,5 +412,5 @@
 }
 //-----------------------------------------------------------------------
-void MouseQueryListener::clamp2Terrain()
+void MouseQueryListener::Clamp2Terrain()
 {
 	// clamp to terrain
@@ -379,16 +440,9 @@
 	KEY_PRESSED(KC_1, 0.3, toggleShowViz());
 	KEY_PRESSED(KC_2, 0.3, toggleRenderNodesForViz());
-
-	if (!mShowVisualization)
-	{
-		KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10));
-		KEY_PRESSED(KC_ADD, 0, changeThreshold(10));
-	}
-	else
-	{
-		KEY_PRESSED(KC_SUBTRACT, 0, zoomVizCamera(50));
-		KEY_PRESSED(KC_ADD, 0, zoomVizCamera(-50));
-	}
-
+	KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10));
+	KEY_PRESSED(KC_ADD, 0, changeThreshold(10));
+	KEY_PRESSED(KC_3, 0, zoomVizCamera(50));
+	KEY_PRESSED(KC_4, 0, zoomVizCamera(-50));
+	
 	updateStats();
 
@@ -521,10 +575,12 @@
 		//vizvp->setClearEveryFrame(false);
 
-		// Create a skyplane (for visualization)
-		/*Plane plane;
-		plane.d = 1000;
+		// Create a skyplane (for visualization background)
+		/*
+		Plane plane;
+		plane.d = -1000;
 		plane.normal = Vector3::UNIT_Y;
-		mSceneMgr->setSkyPlane( true, plane, "Examples/Rockwall", 4000, 75, false);
+		mSceneMgr->setSkyPlane(true, plane, "Examples/TransparentTest", 4000, 75, false);
 		*/
+		
 	}
 	else
Index: trunk/VUT/work/TestCullingTerrain/IoManager.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/IoManager.h	(revision 104)
+++ trunk/VUT/work/TestCullingTerrain/IoManager.h	(revision 104)
@@ -0,0 +1,22 @@
+#ifndef _IoManager_H__
+#define _IoManager_H__
+
+#include <OgrePrerequisites.h>
+#include <OgreMath.h>
+#include <Ogre.h>
+
+class IoManager
+{
+public:
+	IoManager(Ogre::String fileName);
+
+	void Write();
+	AddNode(SceneNode *node);
+
+protected:
+	std::ofstream mFile;
+	std::vector<Ogre::Vector3> mPositions;
+	std::vector<Ogre::Quaternion> mOrientations;
+};
+
+#endif // IoManager
Index: trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.h	(revision 85)
+++ trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.h	(revision 104)
@@ -35,4 +35,6 @@
 	void SetMaxHeight(Real maxHeight);
 	
+	RayQueryExecutor *GetRayQueryExecutor();
+
 protected:
 	RayQueryExecutor *mRayQueryExecutor;
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h	(revision 103)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h	(revision 104)
@@ -88,6 +88,9 @@
 	void moveCamera();
 
+
 protected:
-	void clamp2Terrain();
+	void Clamp2Terrain();
+
+	bool NextLocation();
 
     bool mLMouseDown, mRMouseDown;     // True if the mouse buttons are down
@@ -128,5 +131,10 @@
 	Camera *mVizCamera;
 	SceneNode *mCamNode;
+	Real mWalkSpeed;
+	Real mDistance;
+	Vector3 mDestination;
+	Vector3 mDirection;
 
+	std::deque<Vector3> mWalkList;   // The list of points we are walking to
 };
 
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h	(revision 61)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h	(revision 104)
@@ -156,5 +156,5 @@
     Octree * mParent;
 
-#ifdef OGRE_COHERENT_OCCLUSION_CULLING
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
 	public:
 		/** Returns last visited frame id. */
@@ -194,5 +194,5 @@
 		int mDepth;
 
-#endif //OGRE_COHERENT_OCCLUSION_CULLING
+#endif // GTP_VISIBILITY_MODIFIED_OGRE
 };
 
Index: trunk/VUT/work/TestCulling/SceneContentGenerator.cpp
===================================================================
--- trunk/VUT/work/TestCulling/SceneContentGenerator.cpp	(revision 94)
+++ trunk/VUT/work/TestCulling/SceneContentGenerator.cpp	(revision 104)
@@ -73,10 +73,4 @@
 	currentObject->roll(Degree(rotation.z));
 
-	/*
-	char msg[100];
-	sprintf(msg, "pos: %3.3f %3.3f %3.3f\n", position.x, position.y, position.z);
-	OutputDebugString(msg);
-	*/
-
 	return currentObject;
 }
Index: trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 103)
+++ trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 104)
@@ -93,4 +93,5 @@
 	{	
 		TerrainSceneManager::_renderVisibleObjects();
+	
 		return;
 	} 
Index: trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp	(revision 100)
+++ trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp	(revision 104)
@@ -39,5 +39,5 @@
 namespace Ogre {
 
-// VisibilityDotSceneManager *occlusionDotPlugin;
+// VisibilityDotSceneManager *cullingDotPlugin;
 VisibilityOctreeSceneManager *cullingOctreePlugin;
 VisibilityTerrainSceneManager *cullingTerrainPlugin;
