MorphGeometry fixes
This commit is contained in:
committed by
Robert Osfield
parent
40ccf503e4
commit
ce28b2e43e
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user