Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityPredictor.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityPredictor.h	(revision 2557)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityPredictor.h	(revision 2557)
@@ -0,0 +1,31 @@
+#ifndef _OGREVISIBILITYPREDICTOR_H__
+#define _OGREVISIBILITYPREDICTOR_H__
+
+#include <Ogre.h>
+#include "ViewCellsManager.h"
+#include "HierarchyInterface.h"
+
+
+namespace Ogre {
+ 
+/** Visibility predictor
+*/
+
+class __declspec(dllexport) VisibilityPredictor
+{
+public:
+    
+	void HandleProbablyVisibleObjects(GtpVisibilityPreprocessor::ViewCell *vc);
+	void UpdateVisibility(GtpVisibilityPreprocessor::ViewCell *vc);
+
+	VisibilityPredictor();
+
+protected:
+
+	GtpVisibility::HierarchyNodeContainer mNodeBuffer;
+};
+
+
+} // namespace Ogre
+
+#endif // VisibilityPredictor
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2532)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2557)
@@ -525,4 +525,7 @@
 			</File>
 			<File
+				RelativePath="..\include\OgreVisibilityPredictor.h">
+			</File>
+			<File
 				RelativePath="..\include\VisibilityMesh.h">
 			</File>
@@ -563,4 +566,7 @@
 			<File
 				RelativePath="..\src\OgreVisibilityOptionsManager.cpp">
+			</File>
+			<File
+				RelativePath=".\OgreVisibilityPredictor.cpp">
 			</File>
 			<File
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityPredictor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityPredictor.cpp	(revision 2557)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityPredictor.cpp	(revision 2557)
@@ -0,0 +1,91 @@
+#include "OgreVisibilityPredictor.h"
+#include "OgreBoundingBoxConverter.h"
+#include "DistanceQueue.h"
+
+
+const static int maxInvisibleNodesSize = 50;
+
+
+namespace Ogre
+{
+	VisibilityPredictor::VisibilityPredictor()
+	{
+	}
+
+	void VisibilityPredictor::HandleProbablyVisibleObjects(GtpVisibilityPreprocessor::ViewCell *vc)
+	{
+		GtpVisibility::QueryQueue queryQueue;
+		GtpVisibility::HierarchyNodeContainer invisibleNodes;
+
+		// use multiqueries for the objects that are probably invisible
+        GtpVisibilityPreprocessor::ObjectPvsIterator pit = vc->GetPvs().GetIterator();
+
+		while (pit.HasMoreEntries())
+		{		
+			GtpVisibilityPreprocessor::Intersectable *obj = pit.Next();
+            
+			if (obj->Type() != GtpVisibilityPreprocessor::Intersectable::ENGINE_INTERSECTABLE)
+				continue;
+		
+			EngineIntersectable *oi = static_cast<EngineIntersectable *>(obj);
+
+			EntityContainer *entries = oi->GetItem();
+			
+			EntityContainer::const_iterator eit, eit_end = entries->end();
+
+			for (eit = entries->begin(); eit != eit_end; ++ eit)
+			{
+				// collect entities for multiqueries
+				//invisibleNodes.push_back(node);
+
+				if ((int)invisibleNodes.size() >= maxInvisibleNodesSize)
+				{
+					// issue the batched queries
+					//IssueBatchedQuery(invisibleNodes);
+				}
+			}
+		}
+	
+		while(!queryQueue.empty())
+		{
+			unsigned int visiblePixels;
+
+			// fetch multiquery result
+			queryQueue.front().second->GetQueryResult(visiblePixels, false);
+
+			// collect nodes assoziated with current multiquery
+			GtpVisibility::HierarchyNode *node = queryQueue.front().first;
+
+			// tested visible
+			if (visiblePixels > 0)
+			{
+				// render nodes
+				
+				// we have to store and test individual nodes later
+				mNodeBuffer.push_back(node);
+			}
+
+			queryQueue.pop();
+		}	
+	}
+
+
+	void VisibilityPredictor::UpdateVisibility(GtpVisibilityPreprocessor::ViewCell *vc)
+	{
+		GtpVisibility::HierarchyNodeContainer::const_iterator nit, nit_end = mNodeBuffer.end();
+
+		// test individual nodes
+		for (nit = mNodeBuffer.begin(); nit != nit_end; ++ nit)
+		{
+
+		}
+
+		// fetch query results, update PVS of view cell
+		for (nit = mNodeBuffer.begin(); nit != nit_end; ++ nit)
+		{
+
+		}
+
+		mNodeBuffer.clear();
+	}
+}
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 2532)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 2557)
@@ -5,5 +5,4 @@
 
 #include "OgreOcclusionQueriesQueryManager.h"
-//#include "OgrePlatformHierarchyInterface.h"
 #include "OgreOcclusionCullingSceneManager.h"
 #include "VisibilityEnvironment.h"
