replace VertexInfluence to BoneInfluenceList

and VertexIndexWeight to IndexWeight

fix in example
This commit is contained in:
Julien Valentin
2017-08-27 02:14:12 +02:00
parent 4f0256bcc3
commit ca224c81dd
8 changed files with 25 additions and 25 deletions

View File

@@ -20,7 +20,7 @@
using namespace osgAnimation;
void VertexInfluenceSet::addVertexInfluence(const VertexInfluence& v) { _bone2Vertexes.push_back(v); }
void VertexInfluenceSet::addVertexInfluence(const BoneInfluenceList& v) { _bone2Vertexes.push_back(v); }
const VertexInfluenceSet::VertIDToBoneWeightList& VertexInfluenceSet::getVertexToBoneList() const { return _vertex2Bones;}
// this class manage VertexInfluence database by mesh
// reference bones per vertex ...
@@ -33,11 +33,11 @@ void VertexInfluenceSet::buildVertex2BoneList(unsigned int numvertices)
for (BoneToVertexList::const_iterator it = _bone2Vertexes.begin(); it != _bone2Vertexes.end(); ++it)
{
const VertexInfluence& vi = (*it);
const BoneInfluenceList& vi = (*it);
int size = vi.size();
for (int i = 0; i < size; i++)
{
VertexIndexWeight viw = vi[i];
IndexWeight viw = vi[i];
int index = viw.first;
float weight = viw.second;
if (vi.getName().empty()){

View File

@@ -51,7 +51,7 @@ void ComputeAABBOnBoneVisitor::computeBoundingBoxOnBones() {
osg::Vec3Array *vertices = dynamic_cast<osg::Vec3Array*>(rigGeometry->getVertexArray());
if(!vertices) continue;
osgAnimation::VertexInfluence vxtInf = (*itMap).second;
osgAnimation::BoneInfluenceList vxtInf = (*itMap).second;
//Expand the boundingBox with each vertex
for(unsigned int j = 0; j < vxtInf.size(); j++) {

View File

@@ -200,9 +200,9 @@ protected:
BoneNameBoneMap::iterator bone_it = boneMap.find(vertexInfluencePair->first);
if(bone_it == boneMap.end()) continue;
osg::ref_ptr<osgAnimation::Bone> bone = bone_it->second;
const osgAnimation::VertexInfluence& vertexInfluence = (*vertexInfluencePair).second;
const osgAnimation::BoneInfluenceList& vertexInfluence = (*vertexInfluencePair).second;
for(osgAnimation::VertexInfluence::const_iterator vertexIndexWeight = vertexInfluence.begin(); vertexIndexWeight != vertexInfluence.end(); ++vertexIndexWeight) {
for(osgAnimation::BoneInfluenceList::const_iterator vertexIndexWeight = vertexInfluence.begin(); vertexIndexWeight != vertexInfluence.end(); ++vertexIndexWeight) {
rigGeometryInfluenceByBoneMap[bone.get()][*rigGeometry].addWeight((*vertexIndexWeight).second);
}
}

View File

@@ -813,7 +813,7 @@ bool RigGeometry_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
osgAnimation::VertexInfluence vi;
osgAnimation::BoneInfluenceList vi;
vi.setName(name);
vi.reserve(nbVertexes);
for (int j = 0; j < nbVertexes; j++)
@@ -827,7 +827,7 @@ bool RigGeometry_readLocalData(Object& obj, Input& fr)
fr += 2;
iteratorAdvanced = true;
}
vi.push_back(osgAnimation::VertexIndexWeight(index, weight));
vi.push_back(osgAnimation::IndexWeight(index, weight));
}
if (fr.matchSequence("}"))
{
@@ -863,8 +863,8 @@ bool RigGeometry_writeLocalData(const Object& obj, Output& fw)
name = "Empty";
fw.indent() << "osgAnimation::VertexInfluence \"" << name << "\" " << it->second.size() << " {" << std::endl;
fw.moveIn();
const osgAnimation::VertexInfluence& vi = it->second;
for (osgAnimation::VertexInfluence::const_iterator itv = vi.begin(); itv != vi.end(); itv++)
const osgAnimation::BoneInfluenceList& vi = it->second;
for (osgAnimation::BoneInfluenceList::const_iterator itv = vi.begin(); itv != vi.end(); itv++)
{
fw.indent() << itv->first << " " << itv->second << std::endl;
}

View File

@@ -20,7 +20,7 @@ static bool readInfluenceMap( osgDB::InputStream& is, osgAnimation::RigGeometry&
is.readWrappedString(name);
viSize = is.readSize(); is >> is.BEGIN_BRACKET;
osgAnimation::VertexInfluence vi;
osgAnimation::BoneInfluenceList vi;
vi.setName( name );
vi.reserve( viSize );
for ( unsigned int j=0; j<viSize; ++j )
@@ -28,7 +28,7 @@ static bool readInfluenceMap( osgDB::InputStream& is, osgAnimation::RigGeometry&
int index = 0;
float weight = 0.0f;
is >> index >> weight;
vi.push_back( osgAnimation::VertexIndexWeight(index, weight) );
vi.push_back( osgAnimation::IndexWeight(index, weight) );
}
(*map)[name] = vi;
is >> is.END_BRACKET;
@@ -47,14 +47,14 @@ static bool writeInfluenceMap( osgDB::OutputStream& os, const osgAnimation::RigG
itr!=map->end(); ++itr )
{
std::string name = itr->first;
const osgAnimation::VertexInfluence& vi = itr->second;
const osgAnimation::BoneInfluenceList& vi = itr->second;
if ( name.empty() ) name = "Empty";
os << os.PROPERTY("VertexInfluence");
os.writeWrappedString(name);
os.writeSize(vi.size()) ; os << os.BEGIN_BRACKET << std::endl;
for ( osgAnimation::VertexInfluence::const_iterator vitr=vi.begin();
for ( osgAnimation::BoneInfluenceList::const_iterator vitr=vi.begin();
vitr != vi.end(); ++vitr )
{
os << vitr->first << vitr->second << std::endl;