mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-19 01:16:45 -04:00
RigGeometry: do not allocate new NodePath every frame
This commit is contained in:
parent
6d5aa272fc
commit
94e8560bf8
@ -298,7 +298,7 @@ void RigGeometry::updateBounds(osg::NodeVisitor *nv)
|
|||||||
|
|
||||||
void RigGeometry::updateGeomToSkelMatrix(osg::NodeVisitor *nv)
|
void RigGeometry::updateGeomToSkelMatrix(osg::NodeVisitor *nv)
|
||||||
{
|
{
|
||||||
osg::NodePath path;
|
mSkelToGeomPath.clear();
|
||||||
bool foundSkel = false;
|
bool foundSkel = false;
|
||||||
for (osg::NodePath::const_iterator it = nv->getNodePath().begin(); it != nv->getNodePath().end(); ++it)
|
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;
|
foundSkel = true;
|
||||||
}
|
}
|
||||||
else
|
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)
|
void RigGeometry::setInfluenceMap(osg::ref_ptr<InfluenceMap> influenceMap)
|
||||||
|
@ -48,6 +48,7 @@ namespace SceneUtil
|
|||||||
osg::ref_ptr<osg::Geometry> mSourceGeometry;
|
osg::ref_ptr<osg::Geometry> mSourceGeometry;
|
||||||
Skeleton* mSkeleton;
|
Skeleton* mSkeleton;
|
||||||
|
|
||||||
|
osg::NodePath mSkelToGeomPath;
|
||||||
osg::Matrixf mGeomToSkelMatrix;
|
osg::Matrixf mGeomToSkelMatrix;
|
||||||
|
|
||||||
osg::ref_ptr<InfluenceMap> mInfluenceMap;
|
osg::ref_ptr<InfluenceMap> mInfluenceMap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user