Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj	(revision 1202)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj	(revision 1203)
@@ -154,4 +154,7 @@
 				RelativePath="..\include\TestKdTreeAppListener.h">
 			</File>
+			<File
+				RelativePath="..\include\WinCmdLineParser.h">
+			</File>
 		</Filter>
 	</Files>
Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp	(revision 1202)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp	(revision 1203)
@@ -1,8 +1,9 @@
-#include "TestKdTree.h"
-
 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
 #define WIN32_LEAN_AND_MEAN
 #include "windows.h"
 #endif
+
+#include "TestKdTree.h"
+//#include "WinCmdLineParser.h"
 
 #ifdef __cplusplus
@@ -28,4 +29,13 @@
 		getopt("i", argv, optarg, infile);
 		getopt("o", argv, optarg, outfile);
+
+		//WinCmdLineParser cmdparser(strCmdLine);
+
+		//cmdparser
+		//	.addOpt("o","",ARGUMENT_REQUIRED)
+		//	.addOpt("i","",ARGUMENT_REQUIRED);
+
+		//cmdparser.getOpt("o", outfile);
+		//cmdparser.getOpt("i", infile);
 
 		// Create application object
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1195)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1203)
@@ -17,4 +17,6 @@
 #define KDBRANCHPTR_CAST(a) (static_cast<KdTree::Branch *>(a))
 #define KDLEAFPTR_CAST(a) (static_cast<KdTree::Leaf *>(a))
+
+#define KDTREE_LOGNAME "KdTreeBuild.log"
 
 #include <OgreAxisAlignedBox.h>
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h	(revision 1192)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h	(revision 1203)
@@ -22,5 +22,4 @@
 
 class KdTreeSceneNode;
-//class WireBoundingBox;
 
 class KdTreeSceneManager : public SceneManager
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneNode.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneNode.h	(revision 1187)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneNode.h	(revision 1203)
@@ -28,7 +28,4 @@
 		~KdTreeSceneNode() {};
 
-		// calculate all-enclosing AABB, similar to _updateBounds()
-		void forceComputeAABB(AxisAlignedBox& aabb); // OBSOLETE !!
-
 		// gather info for kd-tree creation
 		virtual void computeScene(PlaneEventList& events, AxisAlignedBox& aabb, int& nObjects, bool includeChildren = true);
@@ -41,18 +38,14 @@
 
 		// return a bounding box enclosing all objects
-		virtual AxisAlignedBox getBoundingBox() const;
-
-		// custom render op, show bounding box instead of axes
-		//virtual void getRenderOperation(RenderOperation& op);
-
-		//virtual void _findVisibleObjects(Camera* cam, RenderQueue* queue, 
-		//	bool includeChildren = true, bool displayNodes = false, bool onlyShadowCasters = false);
+		virtual AxisAlignedBox getBoundingBox(void) const;
 
 		// DEBUG
-		String dumpToString();
+		String dumpToString(void);
 	protected:
 		virtual void _updateBounds(void);
 
-		//AxisAlignedBox mLocalAABB;
+		typedef std::set<String> StringSet;
+
+		static StringSet& getExcludedMovables(void);
 	};
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneNode.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneNode.cpp	(revision 1195)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneNode.cpp	(revision 1203)
@@ -43,6 +43,6 @@
 		/* TODO: find a generic solution where MOVABLE nodes are NOT INSERTED into the KDTREE */
 		/**************************************************************************************/
-		if (mName == "PlayerCamNode")
-			return;
+		//if (mName == "PlayerCamNode")
+		//	return;
 
 		// first compute nodes AABB
@@ -52,12 +52,19 @@
 		for (i = mObjectsByName.begin(); i != mObjectsByName.end(); ++i)
 		{
-			// Merge world bounds of each object
-			mWorldAABB.merge(i->second->getWorldBoundingBox(true));
+			// ignore objects with no actual geometry like frustums & lights
+			if (getExcludedMovables().find(i->second->getMovableType()) == getExcludedMovables().end())
+			{
+				//LogManager::getSingleton().getLog(KDTREE_LOGNAME)->logMessage("Adding movable type " + i->second->getMovableType() + " to KdTree");
+				// Merge world bounds of each object
+				mWorldAABB.merge(i->second->getWorldBoundingBox(true));
+			}
 		}
 
+		// create information for KdTree/SAH
 		if (!mWorldAABB.isNull())
 		{
 			// merge aabb with global AABB
 			aabb.merge(mWorldAABB);
+
 			// increase object count
 			nObjects++;
@@ -68,5 +75,4 @@
 			Vector3 min = mWorldAABB.getMinimum();
 			Vector3 max = mWorldAABB.getMaximum();
-			//PlaneEvent * e;
 			for (int i = 0; i < 3; i++)
 			{
@@ -148,50 +154,26 @@
 
 	// recalculate the world aabb
-	AxisAlignedBox KdTreeSceneNode::getBoundingBox() const
+	AxisAlignedBox KdTreeSceneNode::getBoundingBox(void) const
 	{
-#if 0
-		AxisAlignedBox box;
+		return mWorldAABB;
+	}
 
-		// Update bounds from own attached objects
-		ObjectMap::const_iterator it = mObjectsByName.begin();
-		ObjectMap::const_iterator end = mObjectsByName.end();
-		for ( ; it != end ; ++it)
+	KdTreeSceneNode::StringSet& KdTreeSceneNode::getExcludedMovables(void)
+	{
+		static StringSet sExluded;
+
+		// initialise once
+		if (sExluded.empty())
 		{
-			// Merge world bounds of each object
-			box.merge(it->second->getWorldBoundingBox(true));
+			sExluded.insert("Camera");
+			sExluded.insert("Frustum");
+			sExluded.insert("Light");
 		}
 
-		if (box.getMinimum() != mWorldAABB.getMinimum() ||box.getMaximum() != mWorldAABB.getMaximum())
-		{
-			try
-			{
-				Log * log = LogManager::getSingleton().getLog("KdTreeBuild.log");
-				log->logMessage("mWorldAABB was not up to date");
-			}
-			catch (Exception)
-			{
-				// F.U.
-			}
-		}
-
-		return box;
-#else
-		return mWorldAABB;
-#endif
+		return sExluded;
 	}
 
-	//void KdTreeSceneNode::getRenderOperation(RenderOperation& op)
-	//{
-	//	if (mWireBoundingBox == NULL) 
-	//	{
-	//		mWireBoundingBox = new WireBoundingBox();
-	//	}
-
-	//	mWireBoundingBox->setupBoundingBox(mWorldAABB);
-	//	mWireBoundingBox->getRenderOperation(op);
-	//}
-
 	// DEBUG
-	String KdTreeSceneNode::dumpToString()
+	String KdTreeSceneNode::dumpToString(void)
 	{
 		String objects;
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1195)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1203)
@@ -21,5 +21,4 @@
 #include <OgreMaterialManager.h>
 
-#define KDTREE_LOGNAME "KdTreeBuild.log"
 #define PLT_SIZE 101
 
