- Timestamp:
- 10/27/09 16:37:13 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgAnimation/VertexInfluence.cpp
r10656 r10693 1 1 /* -*-c++-*- 2 * Copyright (C) 2008 Cedric Pinson < mornifle@plopbyte.net>2 * Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net> 3 3 * 4 4 * This library is open source and may be redistributed and/or modified under … … 11 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 12 * OpenSceneGraph Public License for more details. 13 */13 */ 14 14 15 15 #include <osgAnimation/VertexInfluence> … … 20 20 using namespace osgAnimation; 21 21 22 const osgAnimation::VertexInfluenceSet::VertexIndexToBoneWeightMap& osgAnimation::VertexInfluenceSet::getVertexToBoneList() const { return _vertex2Bones;} 22 void VertexInfluenceSet::addVertexInfluence(const VertexInfluence& v) { _bone2Vertexes.push_back(v); } 23 const VertexInfluenceSet::VertexIndexToBoneWeightMap& VertexInfluenceSet::getVertexToBoneList() const { return _vertex2Bones;} 23 24 // this class manage VertexInfluence database by mesh 24 25 // reference bones per vertex ... 25 void osgAnimation::VertexInfluenceSet::buildVertex2BoneList()26 void VertexInfluenceSet::buildVertex2BoneList() 26 27 { 27 28 _vertex2Bones.clear(); … … 36 37 float weight = viw.second; 37 38 if (vi.getName().empty()) 38 osg::notify(osg::WARN) << " osgAnimation::VertexInfluenceSet::buildVertex2BoneList warning vertex " << index << " is not assigned to a bone" << std::endl;39 osg::notify(osg::WARN) << "VertexInfluenceSet::buildVertex2BoneList warning vertex " << index << " is not assigned to a bone" << std::endl; 39 40 _vertex2Bones[index].push_back(BoneWeight(vi.getName(), weight)); 40 41 } … … 65 66 66 67 // sort by name and weight 67 struct SortByNameAndWeight : public std::less< osgAnimation::VertexInfluenceSet::BoneWeight>68 struct SortByNameAndWeight : public std::less<VertexInfluenceSet::BoneWeight> 68 69 { 69 bool operator()(const osgAnimation::VertexInfluenceSet::BoneWeight& b0,70 const osgAnimation::VertexInfluenceSet::BoneWeight& b1) const70 bool operator()(const VertexInfluenceSet::BoneWeight& b0, 71 const VertexInfluenceSet::BoneWeight& b1) const 71 72 { 72 73 if (b0.getBoneName() < b1.getBoneName()) … … 80 81 }; 81 82 82 struct SortByBoneWeightList : public std::less< osgAnimation::VertexInfluenceSet::BoneWeightList>83 struct SortByBoneWeightList : public std::less<VertexInfluenceSet::BoneWeightList> 83 84 { 84 bool operator()(const osgAnimation::VertexInfluenceSet::BoneWeightList& b0,85 const osgAnimation::VertexInfluenceSet::BoneWeightList& b1) const85 bool operator()(const VertexInfluenceSet::BoneWeightList& b0, 86 const VertexInfluenceSet::BoneWeightList& b1) const 86 87 { 87 88 if (b0.size() < b1.size()) … … 103 104 }; 104 105 105 void osgAnimation::VertexInfluenceSet::buildUniqVertexSetToBoneSetList() 106 void VertexInfluenceSet::clear() 107 { 108 _bone2Vertexes.clear(); 109 _uniqVertexSetToBoneSet.clear(); 110 } 111 112 void VertexInfluenceSet::buildUniqVertexSetToBoneSetList() 106 113 { 107 114 _uniqVertexSetToBoneSet.clear(); … … 131 138 } 132 139 } 140
