Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2289)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2360)
@@ -67,5 +67,6 @@
 mUseFromPointQueries(false),
 mQueryMode(NODE_QUERIES),
-mResetMaterialForQueries(false)
+mResetMaterialForQueries(false),
+mRenderPvsForViz(false)
 {
 	Ogre::LogManager::getSingleton().
@@ -180,8 +181,15 @@
 		float max_z = mOptions.scale.z * mOptions.pageSize;
 
-		float maxAxis = std::max(max_x, max_y);
-		maxAxis = std::max(maxAxis, max_z);
-		resize(AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis));
-		//resize(AxisAlignedBox( 0, 0, 0, max_x, max_y, max_z ));
+        if (1)
+		{
+			// keep octree equal at all sides so nodes adapt better to small objects
+			float maxAxis = std::max(max_x, max_y);
+			maxAxis = std::max(maxAxis, max_z);
+			resize(AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis));
+		}
+		else
+		{
+			resize(AxisAlignedBox( 0, 0, 0, max_x, max_y, max_z));
+		}
 
 		setupTerrainMaterial();
@@ -631,68 +639,73 @@
     }
 
-	// add bounding boxes of rendered objects
-	if (0)
-	for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it)
-	{
-		getRenderQueue()->addRenderable(*it);
-	}
-
-	// show current view cell geometry
-    if (mCurrentViewCell)// && mCurrentViewCell->GetMesh())
-	{
-		//const bool showSingleViewCell = true;
-		if (mViewCellsGeometryLoaded)
-		{
-			ShowViewCellsGeometry();
-		}
-		
-		//////////
-		//-- set PVS of view cell visible
-
-		GtpVisibilityPreprocessor::ObjectPvsIterator pit = 
-			mCurrentViewCell->GetPvs().GetIterator();
-
-		MailPvsObjects();
-
-		while (pit.HasMoreEntries())
-		{
-			RenderPvsEntry(pit.Next());
-		}	
-	}
-#if 0
-   if (mRenderNodesForViz || mRenderNodesContentForViz)
-	{
-		// HACK: change node material so it is better suited for visualization
-		MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial");
-		nodeMat->setAmbient(1, 1, 0);
-		nodeMat->setLightingEnabled(true);
-		nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
-
-		for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it)
-		{
-			if (mRenderNodesForViz)
+	if (mRenderPvsForViz)
+	{
+		// show current view cell geometry
+		if (mCurrentViewCell)// && mCurrentViewCell->GetMesh())
+		{
+			//const bool showSingleViewCell = true;
+			if (mViewCellsGeometryLoaded)
 			{
-				// render the visible leaf nodes
-				if ((*it)->numAttachedObjects() && 
-					!(*it)->numChildren() && 
-					((*it)->getAttachedObject(0)->getMovableType() == "Entity") &&
-					(*it)->getAttachedObject(0)->isVisible())
+				ShowViewCellsGeometry();
+			}
+
+			//////////
+			//-- set PVS of view cell visible
+
+			GtpVisibilityPreprocessor::ObjectPvsIterator pit = 
+				mCurrentViewCell->GetPvs().GetIterator();
+
+			MailPvsObjects();
+
+			while (pit.HasMoreEntries())
+			{
+				RenderPvsEntry(pit.Next());
+			}	
+		}
+	}
+	else
+	{
+		// add bounding boxes of rendered objects
+		if (1)
+		{
+			for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it)
+			{
+				getRenderQueue()->addRenderable(*it);
+			}
+		}
+		if (mRenderNodesForViz || mRenderNodesContentForViz)
+		{
+			// HACK: change node material so it is better suited for visualization
+			MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial");
+			nodeMat->setAmbient(1, 1, 0);
+			nodeMat->setLightingEnabled(true);
+			nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
+
+			for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it)
+			{
+				if (mRenderNodesForViz)
 				{
-					//getRenderQueue()->addRenderable((*it));
+					// render the visible leaf nodes
+					if ((*it)->numAttachedObjects() && 
+						!(*it)->numChildren() && 
+						((*it)->getAttachedObject(0)->getMovableType() == "Entity") &&
+						(*it)->getAttachedObject(0)->isVisible())
+					{
+						getRenderQueue()->addRenderable((*it));
+						//(*it)->_addToRenderQueue(cam, getRenderQueue(), false);
+					}
+
+					// render bounding boxes of nodes
+					if (0) (*it)->_addBoundingBoxToQueue(getRenderQueue());
+				}
+
+				// add renderables itself
+				if (mRenderNodesContentForViz) 
+				{
 					(*it)->_addToRenderQueue(cam, getRenderQueue(), false);
 				}
-
-				// add bounding boxes instead of node itself
-				if (0) (*it)->_addBoundingBoxToQueue(getRenderQueue());
 			}
-
-			// add renderables itself
-			if (mRenderNodesContentForViz) 
-			{
-				(*it)->_addToRenderQueue(cam, getRenderQueue(), false);
-			}
-		}
-	}
-#endif
+		}
+	}
 }
 //-----------------------------------------------------------------------
@@ -994,4 +1007,9 @@
 		return true;
 	}
+	if (key == "RenderPvsForViz")
+	{
+		mRenderPvsForViz = (*static_cast<const bool *>(val));
+		return true;
+	}
 	if (key == "SkyBoxEnabled")
 	{
@@ -1016,5 +1034,4 @@
 	if (key == "DelayRenderTransparents")
 	{
-		//LoadScene(mFilename, mViewCellsFilename);
 		mDelayRenderTransparents = (*static_cast<const bool *>(val));
 		return true;
@@ -1925,6 +1942,4 @@
 		ivReader.setLog(log);
 	}
-	
-	//viennaNode->translate(Vector3(-300, -300, 0));
 
 	if (ivReader.loadFile(filename.c_str()))
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2332)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2360)
@@ -189,4 +189,5 @@
 void OctreeHierarchyInterface::DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const
 {	
+#if 0	
 	Octree *octant = static_cast<Octree *>(node);
 
@@ -229,4 +230,5 @@
 	octant->setNumLeaves(numLeaves);
 	octant->setNumVisibleLeaves(numVisibleLeaves);
+#endif
 }
 //-----------------------------------------------------------------------
@@ -285,19 +287,13 @@
 bool OctreeHierarchyInterface::IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const
 {
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	//return static_cast<Octree *>(node)->getVisibilityRatio() > 0.9f;
 	return static_cast<Octree *>(node)->isOctreeFullyVisible();
+}
+//-----------------------------------------------------------------------
+float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const
+{
+#if 0
+	return static_cast<Octree *>(node)->getVisibilityRatio();
 #else
-	return true;
-#endif
-}
-//-----------------------------------------------------------------------
-float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const
-{
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	return static_cast<Octree *>(node)->getVisibilityRatio();
-	//return static_cast<Octree *>(node)->isOctreeFullyVisible();
-#else
-	return true;
+	return 1.0f;
 #endif
 }
