Index: trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 171)
+++ trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 173)
@@ -12,4 +12,55 @@
 #include "TestCullingTerrainApplication.h"
 
+
+//-- captions for overlays
+String TerrainFrameListener::msAlgorithmCaptions[] = 
+{
+	"View Frustum Culling", 
+	"Stop and Wait Culling", 
+	"Coherent Hierarchical Culling"
+};
+
+String TerrainFrameListener::msQueryTypeCaptions[] = 
+{
+	"from camera", 
+	"from viewpoint"
+};
+
+String TerrainFrameListener::msQueryRelativeVisCaptions[] = 
+{
+	"visible pixels", 
+	"relative visibility"
+};
+
+String TerrainFrameListener::msQueryMethodCaptions[] = 
+{
+	"occlusion queries", 
+	"item buffer"
+};
+
+Real TerrainFrameListener::msObjectTerrainOffsets[] = 
+{
+	0,
+	7,
+	0
+};
+
+Real TerrainFrameListener::msObjectScales[] = 
+{
+	0.1,
+	0.6,
+	0.07
+};
+
+String TerrainFrameListener::msObjectCaptions[] =
+{
+	"robot",
+	"athene",
+	//"tree2",
+	//"HongKong_Tower",
+	"ninja"
+	//"ogrehead"
+};
+
 // output file for frame info
 const char* frames_out_filename = "frame.out";
@@ -17,44 +68,4 @@
 const char* objects_out_filename = "objects.out";
 
-
-// --- captions for overlays
-
-String currentAlgorithmCaptions[GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS] = 
-{
-	"View Frustum Culling", 
-	"Stop and Wait Culling", 
-	"Coherent Hierarchical Culling"
-};
-
-String queryTypeCaptions[] = 
-{
-	"from camera", 
-	"from viewpoint"
-};
-
-String queryRelativeVisCaptions[] = 
-{
-	"visible pixels", 
-	"relative visibility"
-};
-
-String queryMethodCaptions[] = 
-{
-	"occlusion queries", 
-	"item buffer"
-};
-
-Real currentObjectTerrainOffsets[] = 
-{
-	0,
-	7,
-	0
-};
-Real currentObjectScales[] = 
-{
-	0.1,
-	0.1,
-	0.07
-};
 
 //-----------------------------------------------------------------------
@@ -210,5 +221,5 @@
 		 mCurrentObject = mTerrainContentGenerator->GenerateSceneObject(
 			 mouseRay.getOrigin()/*queryResult*/, Vector3(val, 0, 0), 
-			 mApplication->getCurrentObjectCaption(mCurrentObjectType));
+			 msObjectCaptions[mCurrentObjectType]);
 		
          mLMouseDown = true; 
@@ -281,5 +292,5 @@
 		 {
 			 // apply offset so object is ON terrain
-			 queryResult.y += currentObjectTerrainOffsets[mCurrentObjectType];
+			 queryResult.y += msObjectTerrainOffsets[mCurrentObjectType];
 			 mCurrentObject->setPosition(queryResult);
 		 }
@@ -414,5 +425,5 @@
 
 	mQueryManager = new OcclusionQueriesQueryManager(sm->GetHierarchyInterface(),
-			mWindow->getViewport(0), false, useItemBuffer);
+			mWindow->getViewport(0), true, useItemBuffer);
 	//mQueryManager = new PlatformQueryManager(sm->GetHierarchyInterface(),	mWindow->getViewport(0), false);
 	
@@ -437,7 +448,7 @@
 		
 	std::stringstream d; 
-	d << queryTypeCaptions[fromPoint ?  1 : 0].c_str() << " "
-	  << queryRelativeVisCaptions[relativeVisibility ? 1 : 0].c_str() << " "
-      << queryMethodCaptions[useItemBuffer ? 1 : 0].c_str();
+	d << msQueryTypeCaptions[fromPoint ?  1 : 0].c_str() << " "
+	  << msQueryRelativeVisCaptions[relativeVisibility ? 1 : 0].c_str() << " "
+      << msQueryMethodCaptions[useItemBuffer ? 1 : 0].c_str();
 	LogManager::getSingleton().logMessage(d.str());
 
@@ -515,7 +526,7 @@
 		
 		sprintf(str, ": %s, %s, %s", 
-				queryTypeCaptions[fromPoint ?  1 : 0].c_str(),
-				queryRelativeVisCaptions[relativeVisibility ? 1 : 0].c_str(),
-				queryMethodCaptions[useItemBuffer ? 1 : 0].c_str());
+				msQueryTypeCaptions[fromPoint ?  1 : 0].c_str(),
+				msQueryRelativeVisCaptions[relativeVisibility ? 1 : 0].c_str(),
+				msQueryMethodCaptions[useItemBuffer ? 1 : 0].c_str());
 
 		mQueryTypeInfo->setCaption(str);
@@ -635,5 +646,5 @@
 		//-- write out stats for recorded walkthrough
 		std::stringstream d;
-		d << "Algorithm: " << currentAlgorithmCaptions[mCurrentAlgorithm] << "\n"
+		d << "Algorithm: " << msAlgorithmCaptions[mCurrentAlgorithm] << "\n"
 		  //<< "avg. FPS: " << mWindow->getAverageFPS() << "\n"
 		  << "avg. FPS: " << avgFps << "\n"
@@ -737,15 +748,14 @@
 
 	// parameters for new object
-	mTerrainContentGenerator->SetOffset(currentObjectTerrainOffsets[mCurrentObjectType]);
-	Real scale = currentObjectScales[mCurrentObjectType];
+	mTerrainContentGenerator->SetOffset(msObjectTerrainOffsets[mCurrentObjectType]);
+	Real scale = msObjectScales[mCurrentObjectType];
 	mTerrainContentGenerator->SetScale(Vector3(scale, scale, scale));
 
-	mCurrentObjectTypeInfo->setCaption(": " + 
-		mApplication->getCurrentObjectCaption(mCurrentObjectType));
+	mCurrentObjectTypeInfo->setCaption(": " + msObjectCaptions[mCurrentObjectType]);
 }
 //-----------------------------------------------------------------------
 void TerrainFrameListener::setAlgorithm(int algorithm)
 {
-	mAlgorithmInfo->setCaption(": " + currentAlgorithmCaptions[mCurrentAlgorithm]);
+	mAlgorithmInfo->setCaption(": " + msAlgorithmCaptions[mCurrentAlgorithm]);
 	mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm);
 }
@@ -1370,5 +1380,5 @@
 	
 	initOverlayElement(&mAlgorithmInfo, ext, "Algorithm", top,
-		": " + currentAlgorithmCaptions[mCurrentAlgorithm]); top += vert_space;
+		": " + msAlgorithmCaptions[mCurrentAlgorithm]); top += vert_space;
 
 	initOverlayElement(&mThresholdInfo, ext, "Threshold", top, ": 0"); top += vert_space;
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 164)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 173)
@@ -11,25 +11,15 @@
 //#include "OgreRefAppWorld.h"
 #include "TestCullingTerrainApplication.h"
-
+#include "TerrainFrameListener.h"
 
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-String currentObjectCaptions[] =
-{
-	"robot",
-	"athene",
-	"ninja"
-	//"ogrehead"
-};
-
-const float walk_duration = 10.0f;
-const float wait_duration = 2.0f;
-const float rotate_factor = 0.7f;
-const float move_factor = 0.03;
-
-/***************************************/
-/*      EntityState implementation     */
-/***************************************/
+
+/**********************************************/
+/*             EntityState implementation     */
+/**********************************************/
+
+
 Vector3 EntityState::msMinPos = Vector3::ZERO;
 Vector3 EntityState::msMaxPos = Vector3::ZERO;
@@ -250,5 +240,5 @@
 	mSunLight->setCastShadows(true);
 
-	// set light angle not too sharp, otherwise shadows textures will be broken
+	// set light angle not too small over the surface, otherwise shadows textures will be broken
 	Vector3 dir(0.5, 1, 0.5);
 	dir.normalise();
@@ -288,5 +278,7 @@
 	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);	*/
 
-	mSceneMgr->setShadowTextureSettings(1024, 2);
+	// Use 512x512 texture in GL since we can't go higher than the window res
+	mSceneMgr->setShadowTextureSettings(512, 2);
+
 	mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
    
@@ -326,5 +318,11 @@
 void  TestCullingTerrainApplication::generateScene(int num, int objectType)
 {
-	mTerrainContentGenerator->GenerateScene(num, currentObjectCaptions[objectType]);
+	Vector3 scale(TerrainFrameListener::msObjectScales[objectType], 
+				  TerrainFrameListener::msObjectScales[objectType],
+				  TerrainFrameListener::msObjectScales[objectType]);
+
+	mTerrainContentGenerator->SetScale(scale);
+	mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]);
+	mTerrainContentGenerator->GenerateScene(num, TerrainFrameListener::msObjectCaptions[objectType]);
 
 	if (objectType != 0) // from our objects, only robot has animation phases
@@ -384,9 +382,4 @@
 }
 //-----------------------------------------------------------------------
-String TestCullingTerrainApplication::getCurrentObjectCaption(int id)
-{
-	return currentObjectCaptions[id];
-}
-//-----------------------------------------------------------------------
 void TestCullingTerrainApplication::chooseSceneManager()
 {
Index: trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h	(revision 164)
+++ trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h	(revision 173)
@@ -13,4 +13,5 @@
 #include "OgrePlatformQueryManager.h"
 
+
 class TestCullingTerrainApplication;
 
@@ -18,6 +19,4 @@
 using namespace Ogre;
 
-// z order index of visualizaion viewport
-#define VIZ_VIEWPORT_Z_ORDER 10
 
 /** Frame listener specialised for terrains.
@@ -84,5 +83,5 @@
    //enum {NODEVIZ_NONE, NODEVIZ_RENDER_GEOMETRY, NODEVIZ_MODES_NUM};
 
-  void zoomVizCamera(int zoom);
+   void zoomVizCamera(int zoom);
 	
    void addFrameInfo(SceneNode *camNode, Real timeElapsed);
@@ -141,8 +140,17 @@
 	void setObjectType(int objectType);
 
+	static String msAlgorithmCaptions[];
+	static String msQueryTypeCaptions[]; 
+	static String msQueryRelativeVisCaptions[];
+	static String msQueryMethodCaptions[];
+	static Real msObjectTerrainOffsets[]; 
+	static Real msObjectScales[];
+	static String msObjectCaptions[];
+
 protected:
 
 	void initHelpOverlayElement(String name, int top);
-	void initOverlayElement(OverlayElement **elInfo, String ext, String name, int top, String caption);
+	void initOverlayElement(OverlayElement **elInfo, String ext, String name, 
+							int top, String caption);
 
 	//-- initialise overlays
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h	(revision 164)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h	(revision 173)
@@ -11,4 +11,17 @@
 #include <OgreEntity.h>
 
+// z order index of visualizaion viewport
+#define VIZ_VIEWPORT_Z_ORDER 10
+
+
+//-- constants for animation
+const float walk_duration = 10.0f;
+const float wait_duration = 2.0f;
+const float rotate_factor = 0.7f;
+const float move_factor = 0.03;
+
+
+/** Rendertarget listener which shows a visualization.
+*/
 class VisualizationRenderTargetListener: public RenderTargetListener
 {
Index: trunk/VUT/work/TestCullingTerrain/TerrainGlobals.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainGlobals.h	(revision 172)
+++ 	(revision )
@@ -1,10 +1,0 @@
-#ifndef _TERRAINGLOBALS_H__
-#define _TERRAINGLOBALS_H__
-
-#include "VisibilityEnvironment.h"
-#include <Ogre.h>
-
-
-
-
-#endif // TERRAINGLOBALS_H
