Show
Ignore:
Timestamp:
10/27/09 16:37:13 (5 years ago)
Author:
cedricpinson
Message:

From Cedric Pinson, The following commit include:
* Refactore of RigGeometry? to support hardware skinning
* Refactore of Timeline to split Action in differents files
* Add example how to use hardware skinning

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgAnimation/VertexInfluence.cpp

    r10656 r10693  
    11/*  -*-c++-*-  
    2  *  Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net> 
     2 *  Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net> 
    33 * 
    44 * This library is open source and may be redistributed and/or modified under   
     
    1111 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
    1212 * OpenSceneGraph Public License for more details. 
    13 */ 
     13 */ 
    1414 
    1515#include <osgAnimation/VertexInfluence> 
     
    2020using namespace osgAnimation; 
    2121 
    22 const osgAnimation::VertexInfluenceSet::VertexIndexToBoneWeightMap& osgAnimation::VertexInfluenceSet::getVertexToBoneList() const { return _vertex2Bones;} 
     22void VertexInfluenceSet::addVertexInfluence(const VertexInfluence& v) { _bone2Vertexes.push_back(v); } 
     23const VertexInfluenceSet::VertexIndexToBoneWeightMap& VertexInfluenceSet::getVertexToBoneList() const { return _vertex2Bones;} 
    2324// this class manage VertexInfluence database by mesh 
    2425// reference bones per vertex ... 
    25 void osgAnimation::VertexInfluenceSet::buildVertex2BoneList() 
     26void VertexInfluenceSet::buildVertex2BoneList() 
    2627{ 
    2728    _vertex2Bones.clear(); 
     
    3637            float weight = viw.second; 
    3738            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; 
    3940            _vertex2Bones[index].push_back(BoneWeight(vi.getName(), weight)); 
    4041        } 
     
    6566 
    6667// sort by name and weight 
    67 struct SortByNameAndWeight : public std::less<osgAnimation::VertexInfluenceSet::BoneWeight> 
     68struct SortByNameAndWeight : public std::less<VertexInfluenceSet::BoneWeight> 
    6869{ 
    69     bool operator()(const osgAnimation::VertexInfluenceSet::BoneWeight& b0,  
    70                     const osgAnimation::VertexInfluenceSet::BoneWeight& b1) const  
     70    bool operator()(const VertexInfluenceSet::BoneWeight& b0,  
     71                    const VertexInfluenceSet::BoneWeight& b1) const  
    7172    { 
    7273        if (b0.getBoneName() < b1.getBoneName()) 
     
    8081}; 
    8182 
    82 struct SortByBoneWeightList : public std::less<osgAnimation::VertexInfluenceSet::BoneWeightList> 
     83struct SortByBoneWeightList : public std::less<VertexInfluenceSet::BoneWeightList> 
    8384{ 
    84     bool operator()(const osgAnimation::VertexInfluenceSet::BoneWeightList& b0,  
    85                     const osgAnimation::VertexInfluenceSet::BoneWeightList& b1) const  
     85    bool operator()(const VertexInfluenceSet::BoneWeightList& b0,  
     86                    const VertexInfluenceSet::BoneWeightList& b1) const  
    8687    { 
    8788        if (b0.size() < b1.size()) 
     
    103104}; 
    104105 
    105 void osgAnimation::VertexInfluenceSet::buildUniqVertexSetToBoneSetList() 
     106void VertexInfluenceSet::clear() 
     107{ 
     108    _bone2Vertexes.clear();  
     109    _uniqVertexSetToBoneSet.clear(); 
     110} 
     111 
     112void VertexInfluenceSet::buildUniqVertexSetToBoneSetList() 
    106113{ 
    107114    _uniqVertexSetToBoneSet.clear(); 
     
    131138    } 
    132139} 
     140