Ignore:
Timestamp:
02/15/07 14:45:30 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h

    r1823 r2119  
    142142        void VisualizeViewCells(const bool visualize); 
    143143 
     144        /** Load an iv scene. 
     145        */ 
    144146        bool LoadSceneIV(const String &filename,  
    145147                                         SceneNode *root,  
    146148                                         const int index); 
    147149 
    148         bool LoadScene(const String &filename); 
     150        /** Load obj scene. 
     151        */ 
     152        bool LoadSceneObj(const String &filename, 
     153                                          const String &viewCellsFile, 
     154                                          SceneNode *root); 
     155 
     156        /** Load a scene. 
     157        */ 
     158        bool LoadScene(const String &filename, const String &viewCellsFilename); 
    149159 
    150160        void loadConfig(DataStreamPtr& stream); 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r2115 r2119  
    2323#include "IntersectableWrapper.h" 
    2424#include "IVReader.h" 
     25#include "ObjReader.h" 
     26 
    2527 
    2628 
     
    154156 
    155157        // load the scene 
    156         LoadScene(mFilename); 
    157          
    158         // load view cells 
    159         //mViewCellsLoaded = LoadViewCells(mViewCellsFilename); 
     158        LoadScene(mFilename, mViewCellsFilename); 
     159         
     160        // load view cells: load later ... 
     161        if (0) mViewCellsLoaded = LoadViewCells(mViewCellsFilename); 
    160162 
    161163        if (mShowTerrain) 
     
    15921594} 
    15931595//----------------------------------------------------------------------- 
    1594 bool OcclusionCullingSceneManager::LoadScene(const String &filename) 
     1596bool OcclusionCullingSceneManager::LoadScene(const String &filename,  
     1597                                                                                         const String &viewCellsFilename) 
    15951598{ 
    15961599        using namespace std; 
     
    16201623                const string fn = *fit; 
    16211624 
    1622                 if (strstr(fn.c_str(), ".iv") || strstr(fn.c_str(), ".wrl")) 
     1625                if (strstr(fn.c_str(), ".obj")) 
     1626                { 
     1627                        // load iv files 
     1628                        if (!LoadSceneObj(filename, viewCellsFilename, getRootSceneNode())) 
     1629                        { 
     1630                                LogManager::getSingleton().logMessage("error loading file"); 
     1631                                return false; 
     1632            } 
     1633                } 
     1634                else if (strstr(fn.c_str(), ".iv") || strstr(fn.c_str(), ".wrl")) 
    16231635                { 
    16241636                        // load iv files 
     
    16821694} 
    16831695//----------------------------------------------------------------------- 
     1696bool OcclusionCullingSceneManager::LoadSceneObj(const String &filename, 
     1697                                                                                                const String &viewCellsFile, 
     1698                                                                                                SceneNode *root) 
     1699{ 
     1700        ObjReader objReader(this); 
     1701 
     1702        Timer *timer = PlatformManager::getSingleton().createTimer(); 
     1703        timer->reset(); 
     1704 
     1705        if (!objReader.LoadFile(filename.c_str(), viewCellsFile, root)) 
     1706        { 
     1707                PlatformManager::getSingleton().destroyTimer(timer); 
     1708                return false; 
     1709        } 
     1710 
     1711        SceneNode *node = root->createChildSceneNode("ObjSceneNode"); 
     1712 
     1713        std::stringstream d;  
     1714        d << "loaded " << filename << " in " << timer->getMilliseconds() * 1e-3 << " secs"; 
     1715        LogManager::getSingleton().logMessage(d.str()); 
     1716                 
     1717        PlatformManager::getSingleton().destroyTimer(timer); 
     1718 
     1719        return true; 
     1720} 
     1721//----------------------------------------------------------------------- 
    16841722const String OcclusionCullingSceneManagerFactory::FACTORY_TYPE_NAME = "OcclusionCullingSceneManager"; 
    16851723//----------------------------------------------------------------------- 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj

    r2111 r2119  
    8989                                OptimizeForProcessor="3" 
    9090                                OptimizeForWindowsApplication="TRUE" 
    91                                 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" 
    92                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE" 
     91                                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;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include" 
     92                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 
    9393                                StringPooling="TRUE" 
    9494                                RuntimeLibrary="2" 
     
    105105                                Name="VCLinkerTool" 
    106106                                IgnoreImportLibrary="TRUE" 
    107                                 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" 
     107                                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 ObjReader.lib" 
    108108                                OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll" 
    109109                                Version="0.99" 
    110110                                LinkIncremental="1" 
    111111                                SuppressStartupBanner="TRUE" 
    112                                 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;" 
     112                                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;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\lib\$(ConfigurationName)&quot;" 
    113113                                ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 
    114114                                GenerateDebugInformation="FALSE" 
Note: See TracChangeset for help on using the changeset viewer.