OGRE手动加载模型与材质

// [8/12/2010 Administrator] // 动态解析 材质脚本 //addMaterial(); { Ogre::FileInfoListPtr fileInfoList = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo( "General", "*.material"); for (Ogre::FileInfoList::const_iterator it = fileInfoList->begin(); it != fileInfoList->end(); ++it) { const WX::String& name = it->filename; const WX::String& basename = it->basename; WX::String s = it->archive->getType(); WX::String sPath = it->archive->getName(); if (s == "FileSystem") { WX::String sNewPath = sPath + "/" + it->path; Ogre::ResourceGroupManager::getSingleton().addResourceLocation(sNewPath, "FileSystem", "General"); //Ogre::ResourcePtr pSrc = Ogre::MaterialManager::getSingleton().load(basename, "General"); Ogre::DataStreamPtr pData = Ogre::ResourceGroupManager::getSingleton().openResource(basename, "General"); Ogre::MaterialManager::getSingleton().parseScript(pData, "General"); //MaterialSerializer::parseScript(, "General"); } //wxTreeItemId item = AddLeaf(root, AS_STRING(name)); //mModelList->SetItemData(item, new ModelItemData(name, AS_STRING(typeName), AS_STRING(parameterName))); } }

你可能感兴趣的:(OGRE手动加载模型与材质)