Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityManager.cpp	(revision 925)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityManager.cpp	(revision 2066)
@@ -115,5 +115,5 @@
 		VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING)
 	{
-		dynamic_cast<CoherentHierarchicalCullingManager *>(mCullingManager)->
+		static_cast<CoherentHierarchicalCullingManager *>(mCullingManager)->
 				SetAssumedVisibility(assumedVisibility);
 	}
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h	(revision 1593)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h	(revision 2066)
@@ -10,4 +10,5 @@
 	Wrapper for Ogre object intances for use with the preprocessed view cells.
 */
+#if 0
 class __declspec(dllexport) OgreMeshInstance: public GtpVisibilityPreprocessor::Intersectable
 {
@@ -56,5 +57,6 @@
 };
 
+
 } // namespace Ogre
-
+#endif
 #endif // OgreMeshIntance
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h	(revision 1676)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h	(revision 2066)
@@ -21,14 +21,13 @@
 typedef vector<Entity *> EntityContainer;
 
-class ObjectsIntersectable: public GtpVisibilityPreprocessor::IntersectableWrapper<EntityContainer *>
+class EngineIntersectable: public GtpVisibilityPreprocessor::IntersectableWrapper<EntityContainer *>
 {
 public:
-	ObjectsIntersectable(EntityContainer *item):
+	EngineIntersectable(EntityContainer *item):
 	GtpVisibilityPreprocessor::IntersectableWrapper<EntityContainer *>(item) {}
 
 	// hack
-	ObjectsIntersectable::~ObjectsIntersectable() 
-	{
-		//CLEAR_CONTAINER(*mItem);
+	EngineIntersectable::~EngineIntersectable() 
+	{
 		delete mItem;
 	}
@@ -36,5 +35,5 @@
 	int Type() const
 	{
-		return Intersectable::OBJECTS_INTERSECTABLE;
+		return Intersectable::ENGINE_INTERSECTABLE;
 	}
 };
@@ -90,4 +89,5 @@
 								 vector<Entity *> &objects) const;
 
+	/// this can be any scene manager
 	T *mSceneMgr;
 };
@@ -108,4 +108,5 @@
 		
 	// get intersecting scene nodes
+	// note: this function must be provided by scene manager
 	mSceneMgr->findNodesIn(mybox, sceneNodeList, NULL);
 		
@@ -169,22 +170,34 @@
 	return bestFittingObj;
 }
-//-----------------------------------------------------------------------
-/*template<typename T>
+
+
+#define ENLARGE_OBJECT_BBOX 0
+#define ENLRAGE_NODE_BBOX 0 
+template<typename T>
 void PlatFormBoundingBoxConverter<T>::FindIntersectingObjects(const AxisAlignedBox &box,
 															  EntityContainer &objects) const
-{//return;
+{
 	list<SceneNode *> sceneNodeList;
 			
-	// get intersecting scene nodes (= candidates)
+	// find intersecting scene nodes to get candidates for intersection
+    // note: this function has to be provided by scene manager
+#if ENLARGE_NODE_BBOX
+	// make search radius larger
 	AxisAlignedBox mybox = EnlargeBox(box);
 	mSceneMgr->findNodesIn(mybox, sceneNodeList, NULL);
-	//mSceneMgr->findNodesIn(box, sceneNodeList, NULL);
 
 	list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end();
 
-	GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = OgreTypeConverter::ConvertFromOgre(mybox);
-	//GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = OgreTypeConverter::ConvertFromOgre(box);
-
-	// find really intersecting objects
+	GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = 
+		OgreTypeConverter::ConvertFromOgre(mybox);
+#else
+
+	mSceneMgr->findNodesIn(box, sceneNodeList, NULL);
+
+	GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = 
+		OgreTypeConverter::ConvertFromOgre(box);
+#endif
+	
+	// loop through the intersected scene nodes
 	for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(); ++ sit)
 	{
@@ -192,4 +205,5 @@
 		SceneNode::ObjectIterator oit = sn->getAttachedObjectIterator();
 
+		// find the objects that intersect the box
         while (oit.hasMoreElements())
 		{
@@ -198,125 +212,23 @@
 			// we are only interested in scene entities
 			if (mo->getMovableType() != "Entity")
+				continue;
+			
+			// get the bounding box of the objects
+#if ENLARGE_OBJECT_BBOX)
+			// compare with enlarged entitiy box
+			const AxisAlignedBox bbox = EnlargeBox(mo->getWorldBoundingBox());
+#else
+			const AxisAlignedBox bbox = mo->getWorldBoundingBox();
+#endif
+
+			// test for intersection (note: function provided of preprocessor)
+			if (Overlap(nodeBox, OgreTypeConverter::ConvertFromOgre(bbox)))
 			{
-				continue;
+				objects.push_back(static_cast<Entity *>(mo));
 			}
-			 
-			//const AxisAlignedBox bbox = EnlargeBox(mo->getWorldBoundingBox());
-			const AxisAlignedBox bbox = mo->getWorldBoundingBox();
-
-			const bool overlaps = Overlap(nodeBox,
-										  OgreTypeConverter::ConvertFromOgre(bbox)
-										  );
-										  //,0.00001);
-	
-			 if (overlaps)
-			 {
-				 objects.push_back(static_cast<Entity *>(mo));
-			 }
 		}
 	}
 }
-*/
-template<typename T>
-void PlatFormBoundingBoxConverter<T>::FindIntersectingObjects(const AxisAlignedBox &box,
-															  EntityContainer &objects) const
-{//return;
-	list<SceneNode *> sceneNodeList;
-			
-	// get intersecting scene nodes (= candidates)
-	//AxisAlignedBox mybox = EnlargeBox(box);
-	//mSceneMgr->findNodesIn(mybox, sceneNodeList, NULL);
-	mSceneMgr->findNodesIn(box, sceneNodeList, NULL);
-
-	list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end();
-
-	//GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = OgreTypeConverter::ConvertFromOgre(mybox);
-	GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = OgreTypeConverter::ConvertFromOgre(box);
-
-	// find really intersecting objects
-	for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(); ++ sit)
-	{
-		SceneNode *sn = *sit;
-		SceneNode::ObjectIterator oit = sn->getAttachedObjectIterator();
-
-        while (oit.hasMoreElements())
-		{
-			MovableObject *mo = oit.getNext();
-
-			// we are only interested in scene entities
-			if (mo->getMovableType() != "Entity")
-			{
-				continue;
-			}
-			 
-			//const AxisAlignedBox bbox = EnlargeBox(mo->getWorldBoundingBox());
-			const AxisAlignedBox bbox = mo->getWorldBoundingBox();
-
-			const bool overlaps = 
-				Overlap(nodeBox, OgreTypeConverter::ConvertFromOgre(bbox));
-										
-	
-			 if (overlaps)
-			 {
-				 objects.push_back(static_cast<Entity *>(mo));
-			 }
-		}
-	}
-}
 #if USE_KD_PVS
-//-------------------------------------------------------------------------
-template<typename T>
-bool PlatFormBoundingBoxConverter<T>::IdentifyObjects(
-	const GtpVisibilityPreprocessor::IndexedBoundingBoxContainer &iboxes,
-	GtpVisibilityPreprocessor::ObjectContainer &objects) const
-{
-	//Ogre::LogManager().logMessage("pvs: intersecting objects");
-	const long startTime = GtpVisibilityPreprocessor::GetTime();
-
-	GtpVisibilityPreprocessor::IndexedBoundingBoxContainer::
-		const_iterator iit, iit_end = iboxes.end();
-  
-	int i = 0;
-
-	for (iit = iboxes.begin(); iit != iit_end; ++ iit, ++ i)
-	{
-		if (0 && ((i % 1000) == 0))
-		{
-			std::stringstream d; d << "found " << i << " objects";
-			Ogre::LogManager().getSingleton().logMessage(d.str());
-		}
-
-		const AxisAlignedBox box = OgreTypeConverter::ConvertToOgre((*iit).second);
-		
-		//GtpVisibilityPreprocessor::ObjectContainer *entryObjects = new EntityContainer();
-		EntityContainer *entryObjects = new EntityContainer();
-
-		// find all objects that intersect the bounding box
-		FindIntersectingObjects(box, *entryObjects);
-
-		/*vector<Entity *>::const_iterator mit, mit_end = sceneObjects.end();
-		
-		for (mit = sceneObjects.begin(); mit != mit_end; ++ mit)
-		{
-			Entity *ent = *mit;
-			// create new mesh instance
-			OgreMeshInstance *omi = new OgreGetOrCreateOgreMeshInstance(ent);
-			//omi->SetId((*iit).first);
-			entryObjects->push_back(omi);
-		}*/
-
-		ObjectsIntersectable *entry = 
-			new ObjectsIntersectable(entryObjects);
-		entry->SetId((*iit).first);
-		//kdObj->mBbox = (*iit).second;
-		objects.push_back(entry);
-	}
-
-	//std::stringstream d; d << "finished object intersection in " << GtpVisibilityPreprocessor::TimeDiff(startTime, GtpVisibilityPreprocessor::GetTime()) * 1e-3 << "secs";
-	//Ogre::LogManager().logMessage(d.str());
-
-	return true;
-}
-#else
 //-------------------------------------------------------------------------
 template<typename T>
@@ -330,16 +242,43 @@
 	for (iit = iboxes.begin(); iit != iit_end; ++ iit)
 	{
+		const AxisAlignedBox box = 
+			OgreTypeConverter::ConvertToOgre((*iit).second);
+		
+		EntityContainer *entryObjects = new EntityContainer();
+
+		// find all objects that intersect the bounding box
+		FindIntersectingObjects(box, *entryObjects);
+
+		EngineIntersectable *entry = 
+			new EngineIntersectable(entryObjects);
+		entry->SetId((*iit).first);
+
+		objects.push_back(entry);
+	}
+
+	return true;
+}
+#else
+//-------------------------------------------------------------------------
+template<typename T>
+bool PlatFormBoundingBoxConverter<T>::IdentifyObjects(
+	const GtpVisibilityPreprocessor::IndexedBoundingBoxContainer &iboxes,
+	GtpVisibilityPreprocessor::ObjectContainer &objects) const
+{
+	GtpVisibilityPreprocessor::IndexedBoundingBoxContainer::
+		const_iterator iit, iit_end = iboxes.end();
+  
+	for (iit = iboxes.begin(); iit != iit_end; ++ iit)
+	{
 		const GtpVisibilityPreprocessor::AxisAlignedBox3 box = (*iit).second;
 		const AxisAlignedBox currentBox = OgreTypeConverter::ConvertToOgre(box);
    
 		Entity *ent = FindBestFittingObject(currentBox);
-
-		if (ent)
-		{
-			// create new mesh instance
-			OgreMeshInstance *omi = new OgreMeshInstance(ent);
-			omi->SetId((*iit).first);
-			objects.push_back(omi);
-		}
+		if (!ent) continue;
+		
+		// create new mesh instance
+		OgreMeshInstance *omi = new OgreMeshInstance(ent);
+		omi->SetId((*iit).first);
+		objects.push_back(omi);
 	}
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1816)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 2066)
@@ -1346,4 +1346,5 @@
 	//////////
 	//-- set PVS of view cell visible
+
 	GtpVisibilityPreprocessor::ObjectPvsIterator pit = vc->GetPvs().GetIterator();
 
@@ -1354,5 +1355,5 @@
 		if (entry.mObject)
 		{
-			OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(entry.mObject);
+			OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(entry.mObject);
 			omi->GetEntity()->setVisible(load);
 		}
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchyInterface.cpp	(revision 1320)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchyInterface.cpp	(revision 2066)
@@ -132,5 +132,5 @@
 	}
 
-	dynamic_cast<BvHierarchySceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box);
+	static_cast<BvHierarchySceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box);
 }
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeHierarchyInterface.cpp	(revision 1304)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeHierarchyInterface.cpp	(revision 2066)
@@ -132,5 +132,5 @@
 	}
 
-	dynamic_cast<KdTreeSceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box);
+	static_cast<KdTreeSceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box);
 }
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp	(revision 925)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp	(revision 2066)
@@ -33,5 +33,5 @@
 			       bool relativeVisibility)
 {
-	SceneManager *sm = //dynamic_cast<PlatformHierarchyInterface *>
+	SceneManager *sm = //static_cast<PlatformHierarchyInterface *>
 		static_cast<PlatformHierarchyInterface *>
 		(mHierarchyInterface)->GetSceneManager();
@@ -96,5 +96,5 @@
 	// we need access to the scene manager and the rendersystem
 	PlatformHierarchyInterface *pfHierarchyInterface = 
-		//dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface);
+		//static_cast<PlatformHierarchyInterface *>(mHierarchyInterface);
 		static_cast<PlatformHierarchyInterface *>(mHierarchyInterface);
 
@@ -195,5 +195,5 @@
 
 	SceneManager *sm = 
-		//dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->GetSceneManager();
+		//static_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->GetSceneManager();
 		static_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->GetSceneManager();
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1593)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 2066)
@@ -1528,5 +1528,5 @@
 			it != leaf->mKdRenderables.end(); it ++)
 		{
-			SceneNode *sn = dynamic_cast<SceneNode *>(*it);
+			SceneNode *sn = static_cast<SceneNode *>(*it);
 
 			if (sn != exclude)
@@ -1606,5 +1606,5 @@
 		while (it != end)
 		{
-			scenenode = dynamic_cast<KdTreeSceneNode *>(*it);
+			scenenode = static_cast<KdTreeSceneNode *>(*it);
 			mBuildLog->logMessage(pad + "# Leaf   level " + 
 				StringConverter::toString(node->getLevel()) + 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneManager.cpp	(revision 1816)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneManager.cpp	(revision 2066)
@@ -1357,5 +1357,5 @@
 		if (entry.mObject)
 		{
-			OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(entry.mObject);
+			OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(entry.mObject);
 			omi->GetEntity()->setVisible(load);
 		}
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreMeshInstance.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreMeshInstance.cpp	(revision 1593)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreMeshInstance.cpp	(revision 2066)
@@ -4,5 +4,4 @@
 namespace Ogre
 {
-
 	OgreMeshInstance::OgreMeshInstance(Entity *ent):
 	GtpVisibilityPreprocessor::Intersectable(), mEntity(ent)
@@ -74,4 +73,3 @@
 		return s;
 	}
-	
 }
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 1823)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2066)
@@ -28,6 +28,7 @@
 
 //-----------------------------------------------------------------------
-OcclusionCullingSceneManager::OcclusionCullingSceneManager(const String& name, 
-							GtpVisibility::VisibilityManager *visManager):
+OcclusionCullingSceneManager::OcclusionCullingSceneManager(
+								const String& name, 
+								GtpVisibility::VisibilityManager *visManager):
 TerrainSceneManager(name),
 mVisibilityManager(visManager), 
@@ -432,7 +433,7 @@
 
 			if (obj->Type() == 
-				GtpVisibilityPreprocessor::Intersectable::OBJECTS_INTERSECTABLE)
+				GtpVisibilityPreprocessor::Intersectable::ENGINE_INTERSECTABLE)
 			{
-				ObjectsIntersectable *oi = dynamic_cast<ObjectsIntersectable *>(obj);
+				EngineIntersectable *oi = static_cast<EngineIntersectable *>(obj);
 
 				EntityContainer *entries = oi->GetItem();
@@ -457,12 +458,12 @@
 			case GtpVisibilityPreprocessor::Intersectable::OGRE_MESH_INSTANCE:
 				{
-					OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(obj);
+					OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(obj);
 					omi->GetEntity()->_updateRenderQueue(getRenderQueue());
 				}
 				break;
 
-			case GtpVisibilityPreprocessor::Intersectable::OBJECTS_INTERSECTABLE:
+			case GtpVisibilityPreprocessor::Intersectable::ENGINE_INTERSECTABLE:
 				{
-					ObjectsIntersectable *oi = dynamic_cast<ObjectsIntersectable *>(obj);
+					EngineIntersectable *oi = static_cast<EngineIntersectable *>(obj);
 
 					EntityContainer *entries = oi->GetItem();
@@ -471,5 +472,5 @@
 					for (eit = entries->begin(); eit != eit_end; ++ eit)
 					{
-						//OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(*eit);
+						//OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(*eit);
 						Entity *ent = *eit;
 						Any newAny = ent->getUserAny();
@@ -1394,16 +1395,13 @@
 			case GtpVisibilityPreprocessor::Intersectable::OGRE_MESH_INSTANCE:
 				{
-					OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(entry);
+					OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(entry);
 					omi->GetEntity()->setVisible(visible);
 					//GtpVisibilityPreprocessor::Debug << "assigned id " << omi->GetId() << endl;
 				}
 				break;
-			case GtpVisibilityPreprocessor::Intersectable::OBJECTS_INTERSECTABLE:
+			case GtpVisibilityPreprocessor::Intersectable::ENGINE_INTERSECTABLE:
 				{
-					//GtpVisibilityPreprocessor::ObjectsIntersectable *oi = 
-					//	dynamic_cast<GtpVisibilityPreprocessor::ObjectsIntersectable *>(entry);
-					ObjectsIntersectable *oi = dynamic_cast<ObjectsIntersectable *>(entry);
-
-					//GtpVisibilityPreprocessor::ObjectContainer *entries = oi->GetItem();
+					EngineIntersectable *oi = static_cast<EngineIntersectable *>(entry);
+
 					EntityContainer *entries = oi->GetItem();
 					EntityContainer::const_iterator eit,
@@ -1411,8 +1409,6 @@
 					for (eit = entries->begin(); eit != eit_end; ++ eit)
 					{
-						//OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(*eit);
 						Entity *ent = *eit;
 						ent->setVisible(visible);
-						//GtpVisibilityPreprocessor::Debug << "assigned id " << omi->GetId() << endl;
 					}
 				}
@@ -1484,14 +1480,14 @@
 			case GtpVisibilityPreprocessor::Intersectable::OGRE_MESH_INSTANCE:
 				{
-					OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(obj);
+					OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(obj);
 					omi->GetEntity()->setVisible(load);
 					//GtpVisibilityPreprocessor::Debug << "assigned id " << omi->GetId() << endl;
 				}
 				break;
-			case GtpVisibilityPreprocessor::Intersectable::OBJECTS_INTERSECTABLE:
+			case GtpVisibilityPreprocessor::Intersectable::ENGINE_INTERSECTABLE:
 				{
-					//GtpVisibilityPreprocessor::ObjectsIntersectable *oi = 
-					//	dynamic_cast<GtpVisibilityPreprocessor::ObjectsIntersectable *>(entry);
-					ObjectsIntersectable *oi = dynamic_cast<ObjectsIntersectable *>(obj);
+					//GtpVisibilityPreprocessor::EngineIntersectable *oi = 
+					//	static_cast<GtpVisibilityPreprocessor::EngineIntersectable *>(entry);
+					EngineIntersectable *oi = static_cast<EngineIntersectable *>(obj);
 
 					//GtpVisibilityPreprocessor::ObjectContainer *entries = oi->GetItem();
@@ -1502,5 +1498,5 @@
 					for (eit = entries->begin(); eit != eit_end; ++ eit)
 					{
-						//OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>(*eit);
+						//OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(*eit);
 						//omi->GetEntity()->setVisible(load);
 						Entity *ent = *eit;
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 944)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2066)
@@ -116,5 +116,5 @@
 		octant->setLastRendered(mFrameId);
 		OctreeSceneManager *ocm = 
-			dynamic_cast<OctreeSceneManager *>(mSceneManager);
+			static_cast<OctreeSceneManager *>(mSceneManager);
 
 		ocm->_renderOctant(mCamera, octant, mOnlyShadowCasters, mLeavePassesInQueue);
@@ -172,6 +172,6 @@
 	}
 
-	//dynamic_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box);
-	dynamic_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box);
+	//static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box);
+	static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box);
 }
 //-----------------------------------------------------------------------
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp	(revision 1344)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp	(revision 2066)
@@ -1536,5 +1536,5 @@
 			it != leaf->mBvhRenderables.end(); it ++)
 		{
-			SceneNode *sn = dynamic_cast<SceneNode *>(*it);
+			SceneNode *sn = static_cast<SceneNode *>(*it);
 
 			if (sn != exclude)
@@ -1618,5 +1618,5 @@
 		while (it != end)
 		{
-			scenenode = dynamic_cast<BvHierarchySceneNode *>(*it);
+			scenenode = static_cast<BvHierarchySceneNode *>(*it);
 			mBuildLog->logMessage(pad + "# Leaf   level " + 
 				StringConverter::toString(node->getLevel()) + 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 1602)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 2066)
@@ -27,5 +27,5 @@
 	// we need access to the scene manager and the rendersystem
 	PlatformHierarchyInterface *pfHierarchyInterface = 
-		//dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface);
+		//static_cast<PlatformHierarchyInterface *>(mHierarchyInterface);
 		static_cast<PlatformHierarchyInterface *>(mHierarchyInterface);
 
