Index: /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2305)
+++ /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2352)
@@ -30,5 +30,6 @@
 	"RUC",
 	"SWC",
-	"DEF"
+	"DEF",
+	"INT"
 };
 
@@ -166,5 +167,7 @@
 mUseVisibilityFilter(false),
 mFloorDist(2),
-mFlushQueue(false)
+mFlushQueue(false),
+m_iShowBoundingBoxes(0),
+m_iBoundingBoxLevel(0)
 {
 	//mInputDevice = PlatformManager::getSingleton().createInputReader();
@@ -1326,4 +1329,12 @@
 }
 
+void TerrainFrameListener::showBoundingBoxes()
+{
+	m_iShowBoundingBoxes++;
+	m_iShowBoundingBoxes%=2;
+	mSceneMgr->setOption("ShowBiHierarchy", (void*)&m_iShowBoundingBoxes);
+}
+
+
 //-----------------------------------------------------------------------
 void TerrainFrameListener::toggleShowViz()
@@ -1486,4 +1497,16 @@
 		mCamNode->resetOrientation();
 		break;
+	case KC_B:
+		showBoundingBoxes();
+		break;
+	case KC_3:
+		if (m_iBoundingBoxLevel>0) m_iBoundingBoxLevel--;
+		mSceneMgr->setOption("HiLiteLevel", (void*)&m_iBoundingBoxLevel);
+		break;
+	case KC_4:
+		m_iBoundingBoxLevel++;
+		mSceneMgr->setOption("HiLiteLevel", (void*)&m_iBoundingBoxLevel);
+		break;
+
 
 
Index: /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2305)
+++ /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2352)
@@ -432,8 +432,11 @@
 	// terrain creation
 	std::string terrain_cfg("terrainCulling.cfg");
+	
 	mSceneMgr->setWorldGeometry(terrain_cfg);
 
 	// was terrain loaded?
 	mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 
+	msShowHillyTerrain=true;
+
 		
 	// hack view point for terrain
@@ -471,8 +474,14 @@
 	{
 		// the objects are generated randomly distributed over the terrain
-		if (1) generateScene(1500, 0); // create robots
-		if (0) generateScene(100, 1); // create ninjas
+		if (1) generateScene(500, 0); // create robots
+		if (0) generateScene(300, 1); // create ninjas
 		if (0) generateScene(1000, 2); // create trees
 	}
+	int MaxDepth=30;
+	mSceneMgr->setOption("BiHierarchyMaxDepth", &MaxDepth);
+	int Mode=1;
+	mSceneMgr->setOption("EnhancedVisibility", &Mode);
+	mSceneMgr->setOption("RebuildBiHierarchy", NULL);
+	mSceneMgr->setOption("RebuildKdTree", NULL);
 }
 //-----------------------------------------------------------------------
@@ -564,7 +573,7 @@
 								 this);
 
-	mTerrainFrameListener->setPriority(10);
-	mTerrainFrameListener->setPriority(10);
-	mRoot->addFrameListener(mTerrainFrameListener);
+	//mTerrainFrameListener->setPriority(10);
+	//mTerrainFrameListener->setPriority(10);
+	mRoot->addFrameListener(mTerrainFrameListener); 
 }
 //-----------------------------------------------------------------------
@@ -583,10 +592,11 @@
 #else
 
-	mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");
-	
-	//mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
+	//mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");
+	
+	//mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 
 	//mSceneMgr = mRoot->createSceneManager("OctreeSceneManager");
-
-	//mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager");
+	//mSceneMgr = mRoot->createSceneManager("BiHierarchySceneManager");
+
+	mSceneMgr = mRoot->createSceneManager("BiTreeTerrainSceneManager");
 	
 #endif
Index: /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2305)
+++ /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2352)
@@ -211,4 +211,6 @@
 	/** Takes one video frame.
 	*/
+
+	void showBoundingBoxes();
 	void takeVideoFrame(std::ofstream &ofstr);
 
@@ -308,4 +310,6 @@
 	int mNumVideoFrames;
 	/// the newly created object
+	int m_iShowBoundingBoxes;
+	int m_iBoundingBoxLevel;
 	SceneNode *mCurrentObject;    
 
