30 #include "MeshLodGenerator/OgreMeshLodGenerator.h"
35 MeshObject::MeshObject(Ogre::String meshName, Ogre::String entityRG, Ogre::String entityName, Ogre::SceneNode* m_scene_node)
36 : m_scene_node(m_scene_node)
38 , m_cast_shadows(true)
76 m_mesh = Ogre::MeshManager::getSingleton().load(meshName, entityRG);
81 StringUtil::splitBaseFilename(meshName, basename, ext);
84 FileInfoListPtr
files = ResourceGroupManager::getSingleton().findResourceFileInfo(entityRG, basename +
"_lod*.mesh");
85 for (FileInfoList::iterator iterFiles =
files->begin(); iterFiles !=
files->end(); ++iterFiles)
87 String
format = basename +
"_lod%d.mesh";
89 int r = sscanf(iterFiles->filename.c_str(),
format.c_str(), &i);
94 Ogre::MeshManager::getSingleton().load(iterFiles->filename, entityRG);
98 FileInfoListPtr files2 = ResourceGroupManager::getSingleton().findResourceFileInfo(entityRG, basename +
"_clod_*.mesh");
99 for (FileInfoList::iterator iterFiles = files2->begin(); iterFiles != files2->end(); ++iterFiles)
102 String
format = basename +
"_clod_%d.mesh";
104 int r = sscanf(iterFiles->filename.c_str(),
format.c_str(), &i);
108 Ogre::MeshManager::getSingleton().load(iterFiles->filename, entityRG);
119 catch (Ogre::Exception& e)
121 RoR::LogFormat(
"[RoR] Error creating entity of mesh '%s' (group: '%s'), message: %s",
122 meshName.c_str(), entityRG.c_str(), e.getFullDescription().c_str());