Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj	(revision 2353)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj	(revision 2501)
@@ -98,5 +98,5 @@
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;&quot;..\..\..\..\..\Lib\Vis\Preprocessing\lib\$(ConfigurationName)&quot;"
-				GenerateDebugInformation="TRUE"
+				GenerateDebugInformation="FALSE"
 				SubSystem="2"
 				OptimizeReferences="2"
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2455)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2501)
@@ -169,5 +169,6 @@
 mFlushQueue(false),
 m_iShowBoundingBoxes(0),
-m_iBoundingBoxLevel(0)
+m_iBoundingBoxLevel(0),
+mMoveFactor(1000)
 {
 	mEventProcessor = new EventProcessor();
@@ -231,5 +232,5 @@
 	mLoadingOverlay->hide();
 
-	// note: larger magnification for terrain to show single objects
+	// hack: larger magnification for terrain to show single objects
 	if (TestCullingTerrainApplication::msShowHillyTerrain)
 		mVizScale = 25;
@@ -522,6 +523,5 @@
 		
 		// move by a constant so view plane is on "bottom" of viewport
-        const float moveFactor = 1000;
-		mVizCamera->moveRelative(Vector3(0, moveFactor, 0));
+		mVizCamera->moveRelative(Vector3(0, mMoveFactor, 0));
 	}
 	else
@@ -555,5 +555,6 @@
 			mWindow->setDebugText("Recording frame " + 
 				StringConverter::toString((int)mFrameInfo.size() - 1));
-		}	
+		}
+
 		// move camera according to input
 		moveCamera();
@@ -1019,7 +1020,5 @@
 
 	if (mVizScale < 1) 
-	{	
 		mVizScale = 1;
-	}
 
 	mSceneMgr->setOption("NodeVizScale", &mVizScale);
@@ -1431,13 +1430,20 @@
 		break;
 
+	// assumed visible #frames
+	case KC_9:
+		changeAssumedVisibility(-5);
+		break;
+	case KC_0:
+		changeAssumedVisibility(5);
+		break;
+
 	case KC_ESCAPE:
 		mShutdownRequested = true;
 		e->consume();
 		return;
-
+	// the visibility algorithm
 	case KC_SPACE:
 		nextAlgorithm();
 		break;
-
 	case KC_LSHIFT:
 		mShiftPressed = true;
@@ -1446,5 +1452,5 @@
 		mDeleteObjects = true;
 		break;
-
+	// not working yet
 	case KC_C:
 		if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY)
@@ -1460,5 +1466,4 @@
 		mSavePrecomputedFps = !mSavePrecomputedFps;
 		break;
-
     case KC_F:
 		nextFilter();
@@ -1483,4 +1488,5 @@
 		toggleDisplayCameraDetails();
 		break;
+	// if view cells + PVS are used for rendering
 	case KC_V:
 		toggleUseViewCells();
@@ -1522,5 +1528,4 @@
 
 
-
 	///////////////
 	//-- visualization
@@ -1532,6 +1537,8 @@
 		nextNodeVizMode();
 		break;
-	case KC_7:
-		{
+	
+	case KC_F12:
+		{
+			LogManager::getSingleton().logMessage("generating 500 objects");
 			// generate new objects
 			const int numObjects = 500;
@@ -1539,14 +1546,4 @@
 		}
 		break;
-	case KC_8:
-		changeAssumedVisibility(-5);
-		// changeAssumedVisibility(-500);
-		break;
-	case KC_9:
-		changeAssumedVisibility(5);
-		// changeAssumedVisibility(500);
-		break;
-
-//#if USE_PERFHUD
 	case KC_F1:
 		toggleShowHelp();
@@ -1562,49 +1559,33 @@
 		toggleRecord();
 		break;
-
 	case KC_F5:
 		{
-			unsigned int pixels = 0;
-			mSceneMgr->getOption("VisibleObjects", &pixels);
-
-			std::stringstream d; d << "visible objects: " << pixels;
-			LogManager::getSingleton().logMessage(d.str());
-			const bool fromPoint = false;
-			//applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer);
+			mSceneMgr->_findVisibleObjects(mCamera, false);
+			if (0) applyVisibilityQuery(false, mShiftPressed, mUseItemBuffer);
 			break;
 		}
-
 	case KC_F6:
 		{
 			const bool fromPoint = true;
-			applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer);
+			if (1) applyVisibilityQuery(fromPoint, mShiftPressed, mUseItemBuffer);
 			break;
 		}	
+	// change type of object to be generated
 	case KC_F7:
 		++ mCurrentObjectType;
 		applyObjectType();
 		break;
-//#endif
-
 	case KC_F8:
-
 		mTerrainContentGenerator->WriteObjects(objects_out_filename);
 		break;
-
 	case KC_F9:
 		mUseAnimation = !mUseAnimation;
 		break;
-
 	case KC_F10:
 		mRecordVideo = !mRecordVideo;
-			
+		break;		
 	case KC_F11:
 		takeScreenshot();
 		break;
-	
-	case KC_F12:
-		break;
-	//KEY_PRESSED(KC_F3, 0.3, writeFrames());
-	//KEY_PRESSED(KC_F4, 0.3, loadFrames());
 	default:
 		break;
@@ -1735,33 +1716,35 @@
 		cursorPressed = true;
     }
+
 	// visualization camera
 	if (mInputDevice->isKeyDown(KC_3))
-	{
 		zoomVizCamera(50);
-	}
+
 	if (mInputDevice->isKeyDown(KC_4))
-	{
 		zoomVizCamera(-50);
-	}
-
+
+	// scale of the visualized objects
+#if 0
 	if (mInputDevice->isKeyDown(KC_5))
-	{
 		changeVizScale(-1);
-	}
 
 	if (mInputDevice->isKeyDown(KC_6))
-	{
 		changeVizScale(1);
-	}
-	
+#else
+
+	const int mFactor = 20;
+	if (mInputDevice->isKeyDown(KC_5))
+		mMoveFactor += mFactor;
+
+	if (mInputDevice->isKeyDown(KC_6))
+		mMoveFactor -= mFactor;
+#endif
+
+	// distance to floor
 	if (mInputDevice->isKeyDown(KC_7))
-	{
 		changeFloorDist(-1);
-	}
-	
+
 	if (mInputDevice->isKeyDown(KC_8))
-	{
 		changeFloorDist(1);
-	}
 
 
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2455)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2501)
@@ -229,4 +229,5 @@
 	mCamNode->attachObject(mCamera);
 	
+
 	///////////////////
 	//-- create visualization camera
@@ -436,6 +437,4 @@
 	// was terrain loaded?
 	mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 
-	msShowHillyTerrain=true;
-
 		
 	// hack view point for terrain
@@ -638,15 +637,16 @@
 	float minVal = 999999999999;
 
+	// find next valid intersection
 	while (rit != qryResult.end() && rit->movable)
 	{
+		// camera is not a real world object
 		if (rit->movable->getName() != "PlayerCam")
 		{
-			// place on the ground object
+			// get the next intersection with a movable object
 			yVal = rit->movable->getWorldBoundingBox().getCenter().y;
-				if (yVal < minVal)
-					minVal = yVal;
-
-			//std::stringstream d; d << "dist: " << dist << endl;
-			//Ogre::LogManager()
+
+			if (yVal < minVal)
+				minVal = yVal;
+
 			success = true;
 		}
@@ -654,11 +654,12 @@
 		++ rit;
 	}
-    
-	// place on the ground object
+
+	// place player on the ground object
 	if (success)
-			mCamNode->setPosition(
-				mCamNode->getPosition().x,
-				minVal + dist, 
-				mCamNode->getPosition().z);
+	{
+		mCamNode->setPosition(mCamNode->getPosition().x,
+							  minVal + dist, 
+							  mCamNode->getPosition().z);
+	}
 
 	OGRE_DELETE(raySceneQuery);
@@ -741,9 +742,9 @@
 
 
+
 /**********************************************************************/
 /*           VisualizationRenderTargetListener implementation         */
 /**********************************************************************/
 
-
 //-----------------------------------------------------------------------
 VisualizationRenderTargetListener::VisualizationRenderTargetListener(SceneManager *sceneMgr)
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2455)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2501)
@@ -477,4 +477,6 @@
 
 	float mFloorDist;
+
+	int mMoveFactor;
 };
 
