mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 01:10:10 +00:00
Fix the optimizer messing up LOD node's children (Fixes #4301)
This commit is contained in:
parent
89c6b59c30
commit
25a6a67508
@ -800,6 +800,13 @@ bool Optimizer::RemoveRedundantNodesVisitor::isOperationPermissible(osg::Node& n
|
||||
isOperationPermissibleForObject(&node);
|
||||
}
|
||||
|
||||
void Optimizer::RemoveRedundantNodesVisitor::apply(osg::LOD& lod)
|
||||
{
|
||||
// don't remove any direct children of the LOD because they are used to define each LOD level.
|
||||
for (unsigned int i=0; i<lod.getNumChildren(); ++i)
|
||||
traverse(*lod.getChild(i));
|
||||
}
|
||||
|
||||
void Optimizer::RemoveRedundantNodesVisitor::apply(osg::Group& group)
|
||||
{
|
||||
if (typeid(group)==typeid(osg::Group) &&
|
||||
@ -1849,6 +1856,12 @@ bool Optimizer::MergeGroupsVisitor::isOperationPermissible(osg::Group& node)
|
||||
isOperationPermissibleForObject(&node);
|
||||
}
|
||||
|
||||
void Optimizer::MergeGroupsVisitor::apply(osg::LOD &lod)
|
||||
{
|
||||
// don't merge the direct children of the LOD because they are used to define each LOD level.
|
||||
traverse(lod);
|
||||
}
|
||||
|
||||
void Optimizer::MergeGroupsVisitor::apply(osg::Group &group)
|
||||
{
|
||||
if (group.getNumChildren() <= 1)
|
||||
|
@ -339,6 +339,7 @@ class Optimizer
|
||||
|
||||
virtual void apply(osg::Group& group);
|
||||
virtual void apply(osg::Transform& transform);
|
||||
virtual void apply(osg::LOD& lod);
|
||||
|
||||
bool isOperationPermissible(osg::Node& node);
|
||||
|
||||
@ -358,6 +359,7 @@ class Optimizer
|
||||
bool isOperationPermissible(osg::Group& node);
|
||||
|
||||
virtual void apply(osg::Group& group);
|
||||
virtual void apply(osg::LOD& lod);
|
||||
};
|
||||
|
||||
class MergeGeometryVisitor : public BaseOptimizerVisitor
|
||||
|
Loading…
Reference in New Issue
Block a user