swap priority in BonePtrWeight comparator< yeild the same VG set

This commit is contained in:
Julien Valentin 2017-08-29 17:32:19 +02:00
parent ce6a316bde
commit fae9729560
2 changed files with 4 additions and 6 deletions

View File

@ -51,11 +51,9 @@ namespace osgAnimation
inline const float & getWeight() const {return second;} inline const float & getWeight() const {return second;}
inline void setWeight(float b) {second=b;} inline void setWeight(float b) {second=b;}
inline bool operator<(const BonePtrWeight &b1) const{ inline bool operator<(const BonePtrWeight &b1) const{
if (getBonePtr() < b1.getBonePtr()) if (second > b1.second)return true;
return true; if (second < b1.second)return false;
else if (getBonePtr() > b1.getBonePtr()) return (first.get() > b1.first.get());
return false;
return (getWeight() < b1.getWeight());
} }
}; };
typedef std::vector<BonePtrWeight> BonePtrWeightList; typedef std::vector<BonePtrWeight> BonePtrWeightList;

View File

@ -120,7 +120,7 @@ void RigTransformSoftware::buildMinimumUpdateSet(const BoneMap&boneMap,const Rig
_uniqInfluenceSet2VertIDList.reserve(unifyBuffer.size()); _uniqInfluenceSet2VertIDList.reserve(unifyBuffer.size());
for (UnifyBoneGroup::const_iterator it = unifyBuffer.begin(); it != unifyBuffer.end(); ++it) for (UnifyBoneGroup::const_iterator it = unifyBuffer.begin(); it != unifyBuffer.end(); ++it)
_uniqInfluenceSet2VertIDList.push_back(it->second); _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) { bool RigTransformSoftware::prepareData(RigGeometry&rig) {