mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-01 04:20:20 +00:00
GeomMorpherController: do not dirty the MorphGeometry unless necessary
This commit is contained in:
parent
0d49c7fa51
commit
38510a56c2
@ -235,7 +235,12 @@ void GeomMorpherController::update(osg::NodeVisitor *nv, osg::Drawable *drawable
|
|||||||
val = interpKey((*it)->mKeys, input);
|
val = interpKey((*it)->mKeys, input);
|
||||||
val = std::max(0.f, std::min(1.f, val));
|
val = std::max(0.f, std::min(1.f, val));
|
||||||
|
|
||||||
morphGeom->setWeight(i, val);
|
osgAnimation::MorphGeometry::MorphTarget& target = morphGeom->getMorphTarget(i);
|
||||||
|
if (target.getWeight() != val)
|
||||||
|
{
|
||||||
|
target.setWeight(val);
|
||||||
|
morphGeom->dirty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user