关于Armature骨骼乱飞问题,整个论坛只有一个人发帖问过。且楼主在解决之后便了无音讯,而且这么多cocos2dxer,竟无一人分享。
颇为气愤。
现已发现,骨骼乱飞,是因为仅有一帧的骨骼部位在播放完毕之后依然还在update。
只要控制好便可。特此申精,分享大众。
附上源代码:
CCArmatureAnimation.cpp:
void CCArmatureAnimation::update(float dt)下
/*needUpdate if for animation "broken body" problem。
when ths animation completed , but the update of animation is still running ,
because of the single frame special case.*/
bool needUpdate = true;
if (m_bIsComplete || m_bIsPause)
{
needUpdate = false;
}
if (needUpdate)
{
CCARRAY_FOREACH(m_pTweenList, object)
{
((CCTween *)object)->update(dt);
}
}
by adolf , function

