Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1203)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1206)
@@ -34,4 +34,5 @@
 namespace Ogre
 {
+	class KdTreeCamera;
 	class KdRenderable;
 	struct SplitInfo;
@@ -519,5 +520,5 @@
 
 		// test visibility of objects and add to render	queue
-		void queueVisibleObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters, 
+		void queueVisibleObjects(KdTreeCamera* cam, RenderQueue* queue, bool onlyShadowCasters, 
 			bool showBoxes, KdTree::NodeList& visibleNodes);
 
@@ -555,6 +556,7 @@
 
 		// recursive rendering function
-		void recQueueVisibleObjects(KdTree::Node * node, unsigned long currentFrame, Camera* cam,
-			RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, KdTree::NodeList& visibleNodes);
+		void recQueueVisibleObjects(KdTree::Node * node, unsigned long currentFrame, KdTreeCamera* cam,
+			RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, 
+			KdTree::NodeList& visibleNodes, bool fullVis = false);
 
 		// recursively find visible nodes
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h	(revision 1203)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h	(revision 1206)
@@ -15,4 +15,5 @@
 #include <VisibilityManager.h>
 #include "OgreKdTree.h"
+#include "OgreKdTreeCamera.h"
 
 #define KDTREE_MAX_DEPTH 12
@@ -38,4 +39,8 @@
 	/************************************************************************/
 
+	/** Override from Scenemanager to create Camera as instance of KdTreeCamera
+	*/
+	virtual Camera* createCamera(const String& name);
+
 	/** Override from SceneManager to create SceneNodes as instance of KdTreeSceneNode
 	*/
@@ -171,4 +176,8 @@
 	*/
 	void WriteLog();
+
+	/** Switches between simple & enhanced visibility
+	*/
+	void setEnhancedVis(bool enhanced);
 
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj	(revision 1195)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj	(revision 1206)
@@ -273,4 +273,7 @@
 				</File>
 				<File
+					RelativePath="..\include\OgreKdTreeCamera.h">
+				</File>
+				<File
 					RelativePath="..\include\OgreKdTreeHierarchyInterface.h">
 				</File>
@@ -287,4 +290,7 @@
 				<File
 					RelativePath="..\src\OgreKdTree.cpp">
+				</File>
+				<File
+					RelativePath="..\src\OgreKdTreeCamera.cpp">
 				</File>
 				<File
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1204)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1206)
@@ -80,4 +80,12 @@
 }
 
+void KdTreeSceneManager::setEnhancedVis(bool enhanced)
+{
+	for (CameraList::iterator it = mCameras.begin(); it != mCameras.end(); it ++)
+	{
+		KDCAMPTR_CAST(it->second)->setEnhancedVisMode(enhanced);
+	}
+}
+
 bool KdTreeSceneManager::setOption(const String& strKey, const void* pValue)
 {
@@ -133,4 +141,10 @@
 		mKdTree = new KdTree(mMaxDepth, mBuildMethod, mHiLiteLevel, mShowAllBoxes, mShowNodes);
 		mKdTree->build(static_cast<KdTreeSceneNode *>(mSceneRoot));
+		return true;
+	}
+	else if (strKey == "EnhancedVisibility")
+	{
+		bool enh = *static_cast<const bool *>(pValue);
+		setEnhancedVis(enh);
 		return true;
 	}
@@ -338,4 +352,9 @@
 		*static_cast<Real *>(pDestValue) = PlaneEvent::KI;
 		return true;
+	}
+	else if (strKey == "EnhancedVisibility")
+	{
+		*static_cast<bool *>(pDestValue) = 
+			KDCAMPTR_CAST(mCameras.begin()->second)->getEnhancedVisMode();
 	}
 	else if (strKey == "BuildMethod")
@@ -441,4 +460,21 @@
 }
 
+Camera* KdTreeSceneManager::createCamera(const String& name)
+{
+	// Check name not used
+	if (mCameras.find(name) != mCameras.end())
+	{
+		OGRE_EXCEPT(
+			Exception::ERR_DUPLICATE_ITEM,
+			"A camera with the name " + name + " already exists",
+			"SceneManager::createCamera" );
+	}
+
+	Camera *c = new KdTreeCamera(name, this);
+	mCameras.insert(CameraList::value_type(name, c));
+
+	return c;
+}
+
 SceneNode* KdTreeSceneManager::createSceneNode(void)
 {
@@ -543,5 +579,5 @@
 			mVisibleNodes.clear();
 			if (mKdTree)
-				mKdTree->queueVisibleObjects(cam, getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes);
+				mKdTree->queueVisibleObjects(KDCAMPTR_CAST(cam), getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes);
 		}
 	}
@@ -565,5 +601,5 @@
 				getRenderQueue()->clear();
 				if (mKdTree)
-					mKdTree->queueVisibleObjects(cam, getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes);
+					mKdTree->queueVisibleObjects(KDCAMPTR_CAST(cam), getRenderQueue(), onlyShadowCasters, mShowBoxes, mVisibleNodes);
 			}
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1203)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1206)
@@ -8,9 +8,9 @@
 */
 
-#include <OgreCamera.h>
 #include "OgreKdTree.h"
 #include "OgreKdRenderable.h"
 #include "OgreKdTreeSceneNode.h"
 #include "OgreKdTreeSceneManager.h"
+#include "OgreKdTreeCamera.h"
 
 #include <OgreStringConverter.h>
@@ -1184,5 +1184,5 @@
 
 	//-------------------------------------------------------------------------
-	void KdTree::queueVisibleObjects(Camera* cam, RenderQueue* queue, bool onlyShadowCasters, 
+	void KdTree::queueVisibleObjects(KdTreeCamera* cam, RenderQueue* queue, bool onlyShadowCasters, 
 		bool showBoxes, KdTree::NodeList& visibleNodes)
 	{
@@ -1194,8 +1194,13 @@
 	//-------------------------------------------------------------------------
 	void KdTree::recQueueVisibleObjects(KdTree::Node * node, unsigned long currentFrame, 
-		Camera* cam, RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, KdTree::NodeList& visibleNodes)
-	{
+		KdTreeCamera* cam, RenderQueue* queue, bool onlyShadowCasters, bool showBoxes, 
+		KdTree::NodeList& visibleNodes, bool fullVis)
+	{
+		KdTreeCamera::NodeVisibility vis = KdTreeCamera::KDNV_PART;
 		// test visibility
-		if (cam->isVisible(node->mAABB))
+		//if (cam->isVisible(node->mAABB))
+		if (fullVis || 
+			((vis = cam->getVisibilityEnhanced(node->mAABB)) != KdTreeCamera::KDNV_NONE))
+			//((vis = (cam->*getVisibility)(node->mAABB)) != KdTreeCamera::KDNV_NONE))
 		{
 			visibleNodes.push_back(node);
@@ -1205,8 +1210,10 @@
 			if (node->getLeftChild())
 				recQueueVisibleObjects(node->getLeftChild(), currentFrame, 
-				cam, queue, onlyShadowCasters, showBoxes, visibleNodes);
+				cam, queue, onlyShadowCasters, showBoxes, visibleNodes, 
+				(fullVis || vis == KdTreeCamera::KDNV_FULL) ? true : false);
 			if (node->getRightChild())
 				recQueueVisibleObjects(node->getRightChild(), currentFrame, 
-				cam, queue, onlyShadowCasters, showBoxes, visibleNodes);
+				cam, queue, onlyShadowCasters, showBoxes, visibleNodes, 
+				(fullVis || vis == KdTreeCamera::KDNV_FULL) ? true : false);
 		}
 	}
