From 4f0256bcc38e9a54b218b5c68bbab3b17c3f06ca Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Sun, 27 Aug 2017 00:10:52 +0200 Subject: [PATCH] remove unused code and remove a commented section --- src/osgAnimation/RigTransformSoftware.cpp | 45 ++--------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/src/osgAnimation/RigTransformSoftware.cpp b/src/osgAnimation/RigTransformSoftware.cpp index 79224cdd1..4ab524cdb 100644 --- a/src/osgAnimation/RigTransformSoftware.cpp +++ b/src/osgAnimation/RigTransformSoftware.cpp @@ -34,45 +34,6 @@ RigTransformSoftware::RigTransformSoftware(const RigTransformSoftware& rts,const } -// sort by name and weight -struct SortByNameAndWeight : public std::less -{ - bool operator()(const VertexInfluenceSet::BoneWeight& b0, - const VertexInfluenceSet::BoneWeight& b1) const - { - if (b0.getBoneName() < b1.getBoneName()) - return true; - else if (b0.getBoneName() > b1.getBoneName()) - return false; - if (b0.getWeight() < b1.getWeight()) - return true; - return false; - } -}; - -struct SortByBoneWeightList : public std::less -{ - bool operator()(const VertexInfluenceSet::BoneWeightList& b0, - const VertexInfluenceSet::BoneWeightList& b1) const - { - if (b0.size() < b1.size()) - return true; - else if (b0.size() > b1.size()) - return false; - - int size = b0.size(); - for (int i = 0; i < size; i++) - { - bool result = SortByNameAndWeight()(b0[i], b1[i]); - if (result) - return true; - else if (SortByNameAndWeight()(b1[i], b0[i])) - return false; - } - return false; - } -}; - bool RigTransformSoftware::init(RigGeometry& geom) { if (!geom.getSkeleton()) @@ -186,13 +147,13 @@ void RigTransformSoftware::initVertexSetFromBones(const BoneMap& map, const Vert } // if a bone referenced by a vertexinfluence is missed it can make the sum less than 1.0 // so we check it and renormalize the all weight bone - /*const double threshold = 1e-4; - if (!_boneSetVertexSet[i].getBones().empty() && + const double threshold = 1e-4; + if (!vg.getBones().empty() && (sumOfWeight < 1.0 - threshold || sumOfWeight > 1.0 + threshold)) { for (int b = 0; b < (int)boneList.size(); b++) boneList[b].setWeight(boneList[b].getWeight() / sumOfWeight); - }*/ + } _uniqInfluenceSet2VertIDList[i].getVertexes() = vg.getVertexes(); } }