From fae9729560193aa4b9c3e5b171e90bfa14bf68af Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Tue, 29 Aug 2017 17:32:19 +0200 Subject: [PATCH] swap priority in BonePtrWeight comparator< yeild the same VG set --- include/osgAnimation/RigTransformSoftware | 8 +++----- src/osgAnimation/RigTransformSoftware.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/osgAnimation/RigTransformSoftware b/include/osgAnimation/RigTransformSoftware index 1632eff96..2a9f28c86 100644 --- a/include/osgAnimation/RigTransformSoftware +++ b/include/osgAnimation/RigTransformSoftware @@ -51,11 +51,9 @@ namespace osgAnimation inline const float & getWeight() const {return second;} inline void setWeight(float b) {second=b;} inline bool operator<(const BonePtrWeight &b1) const{ - if (getBonePtr() < b1.getBonePtr()) - return true; - else if (getBonePtr() > b1.getBonePtr()) - return false; - return (getWeight() < b1.getWeight()); + if (second > b1.second)return true; + if (second < b1.second)return false; + return (first.get() > b1.first.get()); } }; typedef std::vector BonePtrWeightList; diff --git a/src/osgAnimation/RigTransformSoftware.cpp b/src/osgAnimation/RigTransformSoftware.cpp index 676cad8ea..6e54b2cd6 100644 --- a/src/osgAnimation/RigTransformSoftware.cpp +++ b/src/osgAnimation/RigTransformSoftware.cpp @@ -120,7 +120,7 @@ void RigTransformSoftware::buildMinimumUpdateSet(const BoneMap&boneMap,const Rig _uniqInfluenceSet2VertIDList.reserve(unifyBuffer.size()); for (UnifyBoneGroup::const_iterator it = unifyBuffer.begin(); it != unifyBuffer.end(); ++it) _uniqInfluenceSet2VertIDList.push_back(it->second); - OSG_DEBUG << "uniq groups " << _uniqInfluenceSet2VertIDList.size() << " for " << rig.getName() << std::endl; + OSG_WARN << "uniq groups " << _uniqInfluenceSet2VertIDList.size() << " for " << rig.getName() << std::endl; } bool RigTransformSoftware::prepareData(RigGeometry&rig) {