MorphGeometry fixes

This commit is contained in:
Julien Valentin
2016-06-25 18:15:57 +01:00
committed by Robert Osfield
parent 40ccf503e4
commit ce28b2e43e
3 changed files with 74 additions and 4 deletions

View File

@@ -56,6 +56,7 @@ MorphGeometry::MorphGeometry(const MorphGeometry& b, const osg::CopyOp& copyop)
setUseVertexBufferObjects(true);
}
void MorphGeometry::transformSoftwareMethod()
{
if (_dirty)
@@ -279,3 +280,29 @@ bool UpdateMorph::link(osgAnimation::Channel* channel)
}
return false;
}
int UpdateMorph::link(Animation* animation)
{
if (getNumTarget() == 0)
{
osg::notify(osg::WARN) << "An update callback has no name, it means it could link only with \"\" named Target, often an error, discard" << std::endl;
return 0;
}
unsigned int nbLinks = 0;
for (ChannelList::iterator channel = animation->getChannels().begin();
channel != animation->getChannels().end();
++channel)
{
std::string targetName = (*channel)->getTargetName();
for(int i = 0, num = getNumTarget(); i < num; ++i) {
if (targetName == getTargetName(i))
{
AnimationUpdateCallbackBase* a = this;
a->link((*channel).get());
nbLinks++;
}
}
}
return nbLinks;
}