本文整理汇总了C++中ogre::MeshPtr::removeLodLevels方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::removeLodLevels方法的具体用法?C++ MeshPtr::removeLodLevels怎么用?C++ MeshPtr::removeLodLevels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::removeLodLevels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadLod
void LodManager::loadLod(Ogre::MeshPtr mesh, const LodDefinition& def)
{
if (def.getUseAutomaticLod()) {
loadAutomaticLod(mesh);
} else if (def.getLodDistanceCount() == 0) {
mesh->removeLodLevels();
return;
} else {
Ogre::LodStrategy* strategy;
if (def.getStrategy() == LodDefinition::LS_DISTANCE) {
strategy = &Ogre::DistanceLodStrategy::getSingleton();
} else {
strategy = &Ogre::PixelCountLodStrategy::getSingleton();
}
mesh->setLodStrategy(strategy);
if (def.getType() == LodDefinition::LT_AUTOMATIC_VERTEX_REDUCTION) {
// Automatic vertex reduction
LodConfig lodConfig;
lodConfig.mesh = mesh;
const LodDefinition::LodDistanceMap& data = def.getManualLodData();
if (def.getStrategy() == LodDefinition::LS_DISTANCE) {
// TODO: Use C++11 lambda, instead of template.
loadAutomaticLodImpl(data.begin(), data.end(), lodConfig);
} else {
loadAutomaticLodImpl(data.rbegin(), data.rend(), lodConfig);
}
// Uncomment the ProgressiveMesh of your choice.
// NOTE: OgreProgressiveMeshExt doesn't support collapse cost based reduction.
// OgreProgressiveMeshExt pm;
// ProgressiveMeshGenerator pm;
QueuedProgressiveMeshGenerator pm;
pm.build(lodConfig);
} else {
// User created Lod
mesh->removeLodLevels();
const LodDefinition::LodDistanceMap& data = def.getManualLodData();
if (def.getStrategy() == LodDefinition::LS_DISTANCE) {
// TODO: Use C++11 lambda, instead of template.
loadUserLodImpl(data.begin(), data.end(), mesh.get());
} else {
loadUserLodImpl(data.rbegin(), data.rend(), mesh.get());
}
}
}
}