forked from mirror/openmw-tes3mp
Pass the traversal number instead of the node visitor
This commit is contained in:
parent
08b2d38c54
commit
6fa95e72c5
3 changed files with 6 additions and 6 deletions
|
@ -241,7 +241,7 @@ void RigGeometry::update(osg::NodeVisitor* nv)
|
|||
return;
|
||||
mLastFrameNumber = nv->getTraversalNumber();
|
||||
|
||||
mSkeleton->updateBoneMatrices(nv);
|
||||
mSkeleton->updateBoneMatrices(nv->getTraversalNumber());
|
||||
|
||||
// skinning
|
||||
osg::Vec3Array* positionSrc = static_cast<osg::Vec3Array*>(mSourceGeometry->getVertexArray());
|
||||
|
@ -301,7 +301,7 @@ void RigGeometry::updateBounds(osg::NodeVisitor *nv)
|
|||
return;
|
||||
mBoundsFirstFrame = false;
|
||||
|
||||
mSkeleton->updateBoneMatrices(nv);
|
||||
mSkeleton->updateBoneMatrices(nv->getTraversalNumber());
|
||||
|
||||
updateGeomToSkelMatrix(nv);
|
||||
|
||||
|
|
|
@ -108,12 +108,12 @@ Bone* Skeleton::getBone(const std::string &name)
|
|||
return bone;
|
||||
}
|
||||
|
||||
void Skeleton::updateBoneMatrices(osg::NodeVisitor* nv)
|
||||
void Skeleton::updateBoneMatrices(unsigned int traversalNumber)
|
||||
{
|
||||
if (nv->getTraversalNumber() != mLastFrameNumber)
|
||||
if (traversalNumber != mLastFrameNumber)
|
||||
mNeedToUpdateBoneMatrices = true;
|
||||
|
||||
mLastFrameNumber = nv->getTraversalNumber();
|
||||
mLastFrameNumber = traversalNumber;
|
||||
|
||||
if (mLastFrameNumber % 2 == 0)
|
||||
mTraversedEvenFrame = true;
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace SceneUtil
|
|||
Bone* getBone(const std::string& name);
|
||||
|
||||
/// Request an update of bone matrices. May be a no-op if already updated in this frame.
|
||||
void updateBoneMatrices(osg::NodeVisitor* nv);
|
||||
void updateBoneMatrices(unsigned int traversalNumber);
|
||||
|
||||
/// Set the skinning active flag. Inactive skeletons will not have their child rigs updated.
|
||||
/// You should set this flag to false if you know that bones are not currently moving.
|
||||
|
|
Loading…
Reference in a new issue