mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 17:45:33 +00:00
RigGeometry: do not allocate new NodePath every frame
This commit is contained in:
parent
6d5aa272fc
commit
94e8560bf8
2 changed files with 4 additions and 3 deletions
|
@ -298,7 +298,7 @@ void RigGeometry::updateBounds(osg::NodeVisitor *nv)
|
|||
|
||||
void RigGeometry::updateGeomToSkelMatrix(osg::NodeVisitor *nv)
|
||||
{
|
||||
osg::NodePath path;
|
||||
mSkelToGeomPath.clear();
|
||||
bool foundSkel = false;
|
||||
for (osg::NodePath::const_iterator it = nv->getNodePath().begin(); it != nv->getNodePath().end(); ++it)
|
||||
{
|
||||
|
@ -308,9 +308,9 @@ void RigGeometry::updateGeomToSkelMatrix(osg::NodeVisitor *nv)
|
|||
foundSkel = true;
|
||||
}
|
||||
else
|
||||
path.push_back(*it);
|
||||
mSkelToGeomPath.push_back(*it);
|
||||
}
|
||||
mGeomToSkelMatrix = osg::computeWorldToLocal(path);
|
||||
mGeomToSkelMatrix = osg::computeWorldToLocal(mSkelToGeomPath);
|
||||
}
|
||||
|
||||
void RigGeometry::setInfluenceMap(osg::ref_ptr<InfluenceMap> influenceMap)
|
||||
|
|
|
@ -48,6 +48,7 @@ namespace SceneUtil
|
|||
osg::ref_ptr<osg::Geometry> mSourceGeometry;
|
||||
Skeleton* mSkeleton;
|
||||
|
||||
osg::NodePath mSkelToGeomPath;
|
||||
osg::Matrixf mGeomToSkelMatrix;
|
||||
|
||||
osg::ref_ptr<InfluenceMap> mInfluenceMap;
|
||||
|
|
Loading…
Reference in a new issue