Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2259)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2278)
@@ -16,5 +16,6 @@
 	
 	/** Sets the number of nodes in this octree 
-		@remark do not confuse this with the OctreeNode class which is derived from SceneNode
+		@remark do not confuse this with the OctreeNode class 
+		which is derived from SceneNode.
 		@param num number of nodes in the octree
 	*/
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSceneContentGenerator.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSceneContentGenerator.cpp	(revision 1264)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSceneContentGenerator.cpp	(revision 2278)
@@ -157,9 +157,11 @@
 		return false;
 
-	//mSceneNodes.clear(); // reset list of objects
-
-	while (!ifstr.eof()) 
+	while (1)
 	{
 		ifstr.getline(line, 256);
+
+		if (ifstr.eof())
+			break;
+
 		sscanf(line, "%s %f %f %f %f %f %f %f %f %f %f", objName, 
 			&position.x, &position.y, &position.z,
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTerrainContentGenerator.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTerrainContentGenerator.cpp	(revision 164)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTerrainContentGenerator.cpp	(revision 2278)
@@ -43,4 +43,5 @@
 	return false;
 }
+
 
 /*******************************************************/
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2255)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2278)
@@ -26,5 +26,5 @@
 				RuntimeLibrary="3"
 				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
+				RuntimeTypeInfo="FALSE"
 				UsePrecompiledHeader="2"
 				WarningLevel="3"
@@ -113,5 +113,5 @@
 				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\lib\$(ConfigurationName)&quot;"
 				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
-				GenerateDebugInformation="FALSE"
+				GenerateDebugInformation="TRUE"
 				SubSystem="2"
 				OptimizeReferences="2"
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2258)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2278)
@@ -1928,7 +1928,6 @@
 
 		ivReader.buildTree(this, node);
-		
 		ivReader.collapse();
-
+		
 		std::stringstream d; 
 		d << "loaded " << filename << " in " << timer->getMilliseconds() * 1e-3 << " secs";
@@ -1937,7 +1936,7 @@
 		PlatformManager::getSingleton().destroyTimer(timer);
 
-		//-- bake into static geometry
 		/*if (USE_STATIC_GEOMETRY)
 		{
+			//-- bake into static geometry
 			BakeSceneIntoStaticGeometry("staticVienna", "Vienna");
 		}*/
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2259)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2278)
@@ -58,8 +58,11 @@
 	Octree *octree = static_cast<Octree *>(root);
 
-	int mask = (int) (rand() * 8);
+	int mask = (int) (rand() * 8.0f);
 	
 	// random decision
-	Octree *child = octree->mChildren[mask & 1][mask & 2][mask & 3];
+	Octree *child = NULL;
+	
+	while (!child)
+		child = octree->mChildren[(mask & 4) / 4][(mask & 2) / 2][mask & 1];
 
 	return GetRandomLeaf(child);
@@ -173,27 +176,29 @@
 	{
 		octant->setOctreeFullyVisible(octant->isOctreeVisible());
+			
 		return;
 	}
 
-	octant->setOctreeFullyVisible(false);
-
+	octant->setOctreeFullyVisible(true);
+	
 	Octree *nextChild;
-
+	//LogManager::getSingleton().logMessage("***");
 	for (int i = 0; i < 8; ++ i)
 	{
-		int x = i & 4;
-		int y = i & 2;
+		int x = (i & 4) / 4;
+		int y = (i & 2) / 2;
 		int z = i & 1;
+
+		//std::stringstream d; d << "x " << x << " y " << y << " z " << z;
+		//LogManager::getSingleton().logMessage(d.str());
 
 		if ((nextChild = octant->mChildren[x][y][z]) != NULL)
 		{
 			DetermineFullVisibility(nextChild);
+			// this leaf is not fully visible => break
 			if (!nextChild->isOctreeFullyVisible())
-			return;
+				octant->setOctreeFullyVisible(false);
 		}
 	}
-
-	// all children fully visible => pull up
-	octant->setOctreeFullyVisible(true);
 }
 //-----------------------------------------------------------------------
@@ -295,5 +300,4 @@
 	}
 
-	//static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box);
 	static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box);
 }
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2254)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2278)
@@ -95,5 +95,4 @@
 	static RenderOperation ro;
 
-	//LogManager::getSingleton().logMessage("here66");
 	SolidBoundingBox *solidBox = GetSolidBoundingBox();
 	
@@ -182,5 +181,5 @@
 	GtpVisibility::HierarchyNode *node, 
 	const bool wasVisible) 
-{//LogManager::getSingleton().logMessage("here6960");
+{
 	// get next available test id
 	GtpVisibility::OcclusionQuery *query = GetNextOcclusionQuery();
