Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h	(revision 2066)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h	(revision 2069)
@@ -1,4 +1,4 @@
-#ifndef _OgreMeshIntance_H__
-#define _OgreMeshIntance_H__
+#ifndef _OGREMESHINTANCE_H__
+#define _OGREMESHINTANCE_H__
 
 #include <OgreEntity.h>
@@ -10,5 +10,5 @@
 	Wrapper for Ogre object intances for use with the preprocessed view cells.
 */
-#if 0
+#if 1
 class __declspec(dllexport) OgreMeshInstance: public GtpVisibilityPreprocessor::Intersectable
 {
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h	(revision 2066)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h	(revision 2069)
@@ -1,4 +1,4 @@
-#ifndef _PlatFormBoundingBoxConverter_H__
-#define _PlatFormBoundingBoxConverter_H__
+#ifndef _PlatformBoundingBoxConverter_H__
+#define _PlatformBoundingBoxConverter_H__
  
 #include "OgreAxisAlignedBox.h"
@@ -173,5 +173,6 @@
 
 #define ENLARGE_OBJECT_BBOX 0
-#define ENLRAGE_NODE_BBOX 0 
+#define ENLRAGE_NODE_BBOX 0
+
 template<typename T>
 void PlatFormBoundingBoxConverter<T>::FindIntersectingObjects(const AxisAlignedBox &box,
@@ -195,4 +196,6 @@
 	mSceneMgr->findNodesIn(box, sceneNodeList, NULL);
 
+	list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end();
+
 	GtpVisibilityPreprocessor::AxisAlignedBox3 nodeBox = 
 		OgreTypeConverter::ConvertFromOgre(box);
@@ -215,5 +218,5 @@
 			
 			// get the bounding box of the objects
-#if ENLARGE_OBJECT_BBOX)
+#if ENLARGE_OBJECT_BBOX
 			// compare with enlarged entitiy box
 			const AxisAlignedBox bbox = EnlargeBox(mo->getWorldBoundingBox());
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 2069)
@@ -1509,5 +1509,9 @@
 }
 
-void KdTree::recFindNodesIn(const AxisAlignedBox &box, std::list<SceneNode *> &list, SceneNode *exclude, Node * node, bool full)
+void KdTree::recFindNodesIn(const AxisAlignedBox &box, 
+							std::list<SceneNode *> &list, 
+							SceneNode *exclude, 
+							Node * node, 
+							bool full)
 {
 	// check intersection
@@ -1528,5 +1532,5 @@
 			it != leaf->mKdRenderables.end(); it ++)
 		{
-			SceneNode *sn = static_cast<SceneNode *>(*it);
+			SceneNode *sn = static_cast<KdTreeSceneNode *>(*it);
 
 			if (sn != exclude)
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 1926)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2069)
@@ -74,4 +74,281 @@
 			OutputDirectory="..\lib\$(ConfigurationName)"
 			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="FALSE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="0"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\Preprocessing\src\Timer"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="FALSE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib glew32.lib glew32s.lib IVReader.lib"
+				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="mlrt|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib"
+				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib"
+				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release_Internal|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib"
+				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib"
+				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release Internal|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib glew32.lib glew32s.lib"
+				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib"
+				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release_qt|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="2"
 			CharacterSet="2"
@@ -140,281 +417,4 @@
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
 		</Configuration>
-		<Configuration
-			Name="mlrt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="TRUE">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				GlobalOptimizations="TRUE"
-				InlineFunctionExpansion="2"
-				EnableIntrinsicFunctions="TRUE"
-				ImproveFloatingPointConsistency="TRUE"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="TRUE"
-				EnableFiberSafeOptimizations="TRUE"
-				OptimizeForProcessor="2"
-				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				IgnoreImportLibrary="TRUE"
-				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib"
-				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
-				Version="0.99"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib"
-				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
-				GenerateDebugInformation="TRUE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release_Internal|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="TRUE">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				GlobalOptimizations="TRUE"
-				InlineFunctionExpansion="2"
-				EnableIntrinsicFunctions="TRUE"
-				ImproveFloatingPointConsistency="TRUE"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="TRUE"
-				EnableFiberSafeOptimizations="TRUE"
-				OptimizeForProcessor="2"
-				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				IgnoreImportLibrary="TRUE"
-				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib"
-				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
-				Version="0.99"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib"
-				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
-				GenerateDebugInformation="TRUE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release Internal|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="TRUE">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				GlobalOptimizations="TRUE"
-				InlineFunctionExpansion="2"
-				EnableIntrinsicFunctions="TRUE"
-				ImproveFloatingPointConsistency="TRUE"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="TRUE"
-				EnableFiberSafeOptimizations="TRUE"
-				OptimizeForProcessor="2"
-				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				IgnoreImportLibrary="TRUE"
-				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib glew32.lib glew32s.lib"
-				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
-				Version="0.99"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\GtpVisibility\lib\$(ConfigurationName)&quot;;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;&quot;$(CG_LIB_PATH)&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib"
-				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
-				GenerateDebugInformation="TRUE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release_qt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="TRUE">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				GlobalOptimizations="TRUE"
-				InlineFunctionExpansion="2"
-				EnableIntrinsicFunctions="TRUE"
-				ImproveFloatingPointConsistency="TRUE"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="TRUE"
-				EnableFiberSafeOptimizations="TRUE"
-				OptimizeForProcessor="0"
-				OptimizeForWindowsApplication="TRUE"
-				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="FALSE"
-				EnableFunctionLevelLinking="TRUE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				IgnoreImportLibrary="TRUE"
-				AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib glew32.lib glew32s.lib IVReader.lib"
-				OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll"
-				Version="0.99"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;"
-				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
-				GenerateDebugInformation="FALSE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/Plugin_VisibilitySceneManager.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
 	</Configurations>
 	<References>
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchy.cpp	(revision 2069)
@@ -1536,5 +1536,5 @@
 			it != leaf->mBvhRenderables.end(); it ++)
 		{
-			SceneNode *sn = static_cast<SceneNode *>(*it);
+			SceneNode *sn = static_cast<BvHierarchySceneNode *>(*it);
 
 			if (sn != exclude)
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env	(revision 2069)
@@ -12,5 +12,5 @@
 
 Preprocessor {
-samplesPerPass 3000000
+samplesPerPass 6000000
 	useGlRenderer false
 	type vss
@@ -19,7 +19,7 @@
 	loadMeshes false
 	# internal raycaster
-	rayCastMethod 0
+	#rayCastMethod 0
 	# intel raycaster
-	#rayCastMethod 1
+	rayCastMethod 1
 	exportVisibility false
 	loadKdTree false
@@ -159,5 +159,5 @@
 		samples 20000
 		exportRays true
-		exportGeometry true
+		exportGeometry false
 		exportMergedViewCells false
 		useClipPlane true
@@ -167,6 +167,6 @@
 	}
 
-	#showVisualization true
-	showVisualization false
+	showVisualization true
+	#showVisualization false
 	evaluateViewCells false
 	
@@ -190,5 +190,5 @@
 VspBspTree {
 	Construction {
-		samples 2000000
+		samples 900000
 		epsilon 0.0000001
 		randomize false
@@ -238,5 +238,5 @@
 		minGlobalCostRatio      0.0001
 
-		maxViewCells		5000
+		maxViewCells		6000
 	
 		# used for pvs criterium
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 2069)
@@ -679,6 +679,6 @@
 		if (r == mRoot)
 		{
-			Debug << "VSP BSP tree construction time spent at root: "
-				  << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl;
+			cout << "VSP BSP tree construction time spent at root: "
+				 << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl;
 		}
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h	(revision 2063)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h	(revision 2069)
@@ -82,4 +82,5 @@
 	  if (mRays)
 		delete mRays;
+	  cout << "here4" << endl;
 	  mRays = new VssRay[number];
 	  mNumber = number;
@@ -93,5 +94,5 @@
 		if (mIndex == mNumber)
 			mIndex = 0;
-	  return mRays + mIndex++;
+	  return mRays + mIndex ++;
 	}
 
@@ -121,48 +122,48 @@
 	
   struct Intersection
-	{
-		Intersection(): mObject(NULL), mFaceId(0)
-		{}
+  {
+	  Intersection(): mObject(NULL), mFaceId(0)
+	  {}
 
-		Intersection(const Vector3 &p, const Vector3 &n, Intersectable *o, const int f):
-			mPoint(p), mNormal(n), mObject(o), mFaceId(f)
-		{}
+	  Intersection(const Vector3 &p, const Vector3 &n, Intersectable *o, const int f):
+	  mPoint(p), mNormal(n), mObject(o), mFaceId(f)
+	  {}
 
-		Intersection(const Vector3 &p): mPoint(p), mObject(NULL), mFaceId(0)
-		{}
-		Vector3 mPoint;
-		Vector3 mNormal;
-		Intersectable *mObject;
-		int mFaceId;
-	};
+	  Intersection(const Vector3 &p): mPoint(p), mObject(NULL), mFaceId(0)
+	  {}
+	  Vector3 mPoint;
+	  Vector3 mNormal;
+	  Intersectable *mObject;
+	  int mFaceId;
+  };
 
 
-	int ProcessRay(const SimpleRay &ray,
-				   Intersection &hitA,
-				   Intersection &hitB,
-				   VssRayContainer &vssRays,
-				   const AxisAlignedBox3 &box,
-				   const bool castDoubleRay,
-				   const bool pruneInvalidRays = true);
+  int ProcessRay(const SimpleRay &ray,
+	  Intersection &hitA,
+	  Intersection &hitB,
+	  VssRayContainer &vssRays,
+	  const AxisAlignedBox3 &box,
+	  const bool castDoubleRay,
+	  const bool pruneInvalidRays = true);
 
-	/** Checks if ray is valid.
-		I.e., the ray is in valid view space.
-		@note: clamps the ray to valid view space.
-	*/
-	bool ValidateRay(const Vector3 &origin,
-					 const Vector3 &direction,
-        			 const AxisAlignedBox3 &box,
-					 Intersection &hit);
+  /** Checks if ray is valid.
+  I.e., the ray is in valid view space.
+  @note: clamps the ray to valid view space.
+  */
+  bool ValidateRay(const Vector3 &origin,
+	  const Vector3 &direction,
+	  const AxisAlignedBox3 &box,
+	  Intersection &hit);
 
-	bool
-		ClipToViewSpaceBox(const Vector3 &origin,
-						   const Vector3 &termination,
-						   Vector3 &clippedOrigin,
-						   Vector3 &clippedTermination);
-	
+  bool
+	  ClipToViewSpaceBox(const Vector3 &origin,
+	  const Vector3 &termination,
+	  Vector3 &clippedOrigin,
+	  Vector3 &clippedTermination);
 
 
 
-  
+
+
 
   const Preprocessor &mPreprocessor;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2060)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2069)
@@ -1237,9 +1237,4 @@
 				 "render_sampler_use_occlusion_queries=",
 				 "true");
-
-//    RegisterOption("VssPreprocessor.initialSamples",
-// 				 optInt,
-// 				 "vss_initial_samples=",
-// 				 "100000");
   
   RegisterOption("VssPreprocessor.testBeamSampling", 
@@ -1247,19 +1242,4 @@
 				"vss_beam_sampling=", 
 				"false");
-
-//   RegisterOption("VssPreprocessor.vssSamples",
-// 				 optInt,
-// 				 "vss_samples=",
-// 				 "1000000");
-	
-//   RegisterOption("VssPreprocessor.vssSamplesPerPass",
-// 				 optInt,
-// 				 "vss_samples_per_pass=",
-// 				 "1000");
-  
-//   RegisterOption("VssPreprocessor.samplesPerPass",
-// 				 optInt,
-// 				 "vss_samples_per_pass=",
-// 				 "100000");
 
   RegisterOption("VssPreprocessor.useImportanceSampling",
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2069)
@@ -1221,26 +1221,29 @@
 {
 
-  const long t1 = GetTime();
-  if (rays.size() > 10000) {
-	mRayCaster->SortRays(rays);
-	cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl;
-	
-	if (0) {
-	  VssRayContainer tmpRays;
-	  int m = 50000;
-	  for (int i=m; i < m+20; i++) {
-		tmpRays.push_back(new VssRay(rays[i].mOrigin,
-									 rays[i].mOrigin + 100.0f*rays[i].mDirection,
-									 NULL,
-									 NULL
-									 )
-						  );
-		
-	  }
-	  ExportRays("sorted_rays.x3d", tmpRays, 200);
-	}
-  }
-  
-  SimpleRayContainer::const_iterator rit, rit_end = rays.end();
+	const long t1 = GetTime();
+	
+	if ((int)rays.size() > 10000) {
+	
+		//mRayCaster->SortRays(rays);
+		cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl;
+
+		if (0) {
+			VssRayContainer tmpRays;
+			int m = 890000;
+
+			for (int i=m; i < m+20; i++) {
+				tmpRays.push_back(new VssRay(rays[i].mOrigin,
+					rays[i].mOrigin + 100.0f*rays[i].mDirection,
+					NULL,
+					NULL
+					)
+					);
+
+			}
+			ExportRays("sorted_rays.x3d", tmpRays, 200);
+		}
+	}
+
+	SimpleRayContainer::const_iterator rit, rit_end = rays.end();
 
 	SimpleRayContainer rayBucket;
@@ -1298,4 +1301,17 @@
 							pruneInvalidRays);
 		
+	}
+
+	cout << "here5 " << vssRays.size()<<endl;
+
+	if (1) {
+	  VssRayContainer tmpRays;
+	  int m = 700000;
+	  
+	  for (int i=m; i < m+20; i++) {
+		  if (vssRays[i])
+		tmpRays.push_back(vssRays[i]);		
+	  }
+	  ExportRays("sorted_rays2.x3d", tmpRays, 200);
 	}
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2069)
@@ -77,5 +77,5 @@
 				DisableLanguageExtensions="FALSE"
 				ForceConformanceInForLoopScope="FALSE"
-				RuntimeTypeInfo="TRUE"
+				RuntimeTypeInfo="FALSE"
 				UsePrecompiledHeader="0"
 				BrowseInformation="1"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2069)
@@ -3844,27 +3844,4 @@
 	Exporter *exporter;
 
-#if 0
-	// export merged view cells
-	mColorCode = 0; // use random colors
-
-	exporter = Exporter::GetExporter("merged_view_cells.wrl");
-
-	cout << "exporting view cells after merge ... ";
-
-	if (exporter)
-	{
-		if (mExportGeometry)
-		{
-			exporter->ExportGeometry(objects);
-		}
-
-		exporter->SetFilled();
-		ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane());
-
-		delete exporter;
-	}
-	cout << "finished" << endl;
-#endif
-
 	// export merged view cells using pvs color coding
 	exporter = Exporter::GetExporter("merged_view_cells_pvs.wrl");
Index: GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h	(revision 2069)
@@ -1,4 +1,4 @@
-#ifndef __KDINTERSECTABLE_H
-#define __KDINTERSECTABLE_H
+#ifndef __INTERSECTABLEWRAPPER_H
+#define __INTERSECTABLEWRAPPER_H
 
 #include "AxisAlignedBox3.h"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2069)
@@ -8,4 +8,5 @@
 #include "Mutation.h"
 #include "PerfTimer.h"
+
 
 namespace GtpVisibilityPreprocessor {
