本文整理汇总了C++中ogre::MeshPtr::setNull方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::setNull方法的具体用法?C++ MeshPtr::setNull怎么用?C++ MeshPtr::setNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::setNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExportLevel
void OgreExporter_c::ExportLevel(const WadLevel_c &level, const WadFile_c &file)
{
this->ExportLevelMaterials(level, file);
Ogre::DefaultHardwareBufferManager hardwareBufferManager;
Ogre::ManualObject manualMesh(level.GetName());
const LineDef_s *lineDefs = level.GetLineDefs();
const size_t numLineDefs = level.GetNumLineDefs();
const SideDef_s *sideDefs = level.GetSideDefs();
const Sector_s *sectors = level.GetSectors();
const Vertex_s *vertices = level.GetVertices();
for(size_t i = 0;i < numLineDefs; ++i)
{
if(lineDefs[i].iLeftSideDef >= 0)
{
const SideDef_s &leftSide = sideDefs[lineDefs[i].iLeftSideDef];
const Sector_s &leftSideSector = sectors[leftSide.iSector];
const SideDef_s &rightSide = sideDefs[lineDefs[i].iRightSideDef];
const Sector_s &rightSideSector = sectors[rightSide.iSector];
if(leftSide.uMiddleTexture.uName != '-')
{
this->ExportWallMesh(manualMesh, leftSideSector.iFloorHeight, leftSideSector.iCeilHeight, leftSide.uMiddleTexture, leftSide.iOffsetX, leftSide.iOffsety, vertices, lineDefs[i], file);
}
if(leftSide.uLowerTexture.uName != '-')
{
this->ExportWallMesh(manualMesh, leftSideSector.iFloorHeight, leftSideSector.iFloorHeight, leftSide.uLowerTexture, leftSide.iOffsetX, leftSide.iOffsety, vertices, lineDefs[i], file);
}
if(leftSide.uUpperTexture.uName != '-')
{
this->ExportWallMesh(manualMesh, rightSideSector.iCeilHeight, leftSideSector.iCeilHeight, leftSide.uUpperTexture, leftSide.iOffsetX, leftSide.iOffsety, vertices, lineDefs[i], file);
}
}
if(lineDefs[i].iRightSideDef >= 0)
{
const SideDef_s &rightSide = sideDefs[lineDefs[i].iRightSideDef];
const Sector_s &rightSideSector = sectors[rightSide.iSector];
if(rightSide.uLowerTexture.uName != '-')
{
const SideDef_s &leftSide = sideDefs[lineDefs[i].iLeftSideDef];
const Sector_s &leftSideSector = sectors[leftSide.iSector];
this->ExportWallMesh(manualMesh, rightSideSector.iFloorHeight, leftSideSector.iFloorHeight, rightSide.uLowerTexture, rightSide.iOffsetX, rightSide.iOffsety, vertices, lineDefs[i], file);
}
if(rightSide.uMiddleTexture.uName != '-')
{
this->ExportWallMesh(manualMesh, rightSideSector.iFloorHeight, rightSideSector.iCeilHeight, rightSide.uMiddleTexture, rightSide.iOffsetX, rightSide.iOffsety, vertices, lineDefs[i], file);
}
if(rightSide.uUpperTexture.uName != '-')
{
const SideDef_s &leftSide = sideDefs[lineDefs[i].iLeftSideDef];
const Sector_s &leftSideSector = sectors[leftSide.iSector];
this->ExportWallMesh(manualMesh, leftSideSector.iCeilHeight, rightSideSector.iCeilHeight, rightSide.uUpperTexture, rightSide.iOffsetX, rightSide.iOffsety, vertices, lineDefs[i], file);
}
}
}
namespace fs = boost::filesystem;
fs::path path(strLevelDirectory);
std::string levelName = level.GetName();
levelName += ".mesh";
path /= levelName;
Ogre::LogManager logManager;
logManager.createLog("ogre.log", true, true, false);
Ogre::ResourceGroupManager resourceGroupManager;
Ogre::MeshManager meshManager;
Ogre::LodStrategyManager logStrategyManager;
Ogre::MeshPtr mesh = manualMesh.convertToMesh(level.GetName());
Ogre::MeshSerializer serializer;
serializer.exportMesh(mesh.get(), path.string());
mesh.setNull();
resourceGroupManager.shutdownAll();
this->CreateResourcesCfg();
}