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);
 		}
 	}
