- Timestamp:
- 02/15/07 14:45:30 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2115 r2119 23 23 #include "IntersectableWrapper.h" 24 24 #include "IVReader.h" 25 #include "ObjReader.h" 26 25 27 26 28 … … 154 156 155 157 // 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); 160 162 161 163 if (mShowTerrain) … … 1592 1594 } 1593 1595 //----------------------------------------------------------------------- 1594 bool OcclusionCullingSceneManager::LoadScene(const String &filename) 1596 bool OcclusionCullingSceneManager::LoadScene(const String &filename, 1597 const String &viewCellsFilename) 1595 1598 { 1596 1599 using namespace std; … … 1620 1623 const string fn = *fit; 1621 1624 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")) 1623 1635 { 1624 1636 // load iv files … … 1682 1694 } 1683 1695 //----------------------------------------------------------------------- 1696 bool 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 //----------------------------------------------------------------------- 1684 1722 const String OcclusionCullingSceneManagerFactory::FACTORY_TYPE_NAME = "OcclusionCullingSceneManager"; 1685 1723 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.