I want to control times of vertex animtion playing, this model is md2 format.So I set the ‘looping’ of instance of Class VertexAnimationState to ‘false’, but when the animtion play, a error appear in function updateFrames of Class VertexClipNode,“index out of range”. so I edited the code of updateFrames like this:
super.updateFrames();
if (_currentFrame >= _lastFrame)
_currentFrame = _lastFrame - 1;
_currentGeometry = _frames[_currentFrame];
if (_looping && _nextFrame >= _lastFrame)
_nextGeometry = _frames[0];
else
{
if (_nextFrame >= _lastFrame)
_nextFrame = _lastFrame - 1;
_nextGeometry = _frames[_nextFrame];
}
Everything is ok. then I can listen aimationStateEvent.PLAYBACK_COMPLETE to control the times of animtion play.
I am not sure this is right or not. If you know another method,plase tell me. Thank you! -_-|||