diff --git a/components/sceneutil/riggeometry.cpp b/components/sceneutil/riggeometry.cpp index e0746801c..2dea6781e 100644 --- a/components/sceneutil/riggeometry.cpp +++ b/components/sceneutil/riggeometry.cpp @@ -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(mSourceGeometry->getVertexArray()); @@ -301,7 +301,7 @@ void RigGeometry::updateBounds(osg::NodeVisitor *nv) return; mBoundsFirstFrame = false; - mSkeleton->updateBoneMatrices(nv); + mSkeleton->updateBoneMatrices(nv->getTraversalNumber()); updateGeomToSkelMatrix(nv); diff --git a/components/sceneutil/skeleton.cpp b/components/sceneutil/skeleton.cpp index f311de246..08ac72e91 100644 --- a/components/sceneutil/skeleton.cpp +++ b/components/sceneutil/skeleton.cpp @@ -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; diff --git a/components/sceneutil/skeleton.hpp b/components/sceneutil/skeleton.hpp index 9ca1dd49d..835ab6617 100644 --- a/components/sceneutil/skeleton.hpp +++ b/components/sceneutil/skeleton.hpp @@ -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.