[committed] ArrayIndexOutOfIndexException when BoneAnimation has RT_WRAP type

If tpf is large enough, BoneAnimation throws ArrayIndexOutOfIndexException when repeat type is RT_WRAP.



Index: src/com/jme/animation/BoneAnimation.java
===================================================================
--- src/com/jme/animation/BoneAnimation.java   (revision 4490)
+++ src/com/jme/animation/BoneAnimation.java   (working copy)
@@ -539,7 +539,7 @@
             case Controller.RT_WRAP: {
                 currentTime += time * speed;
 
-                if (currentFrame > endFrame) {
+                if (currentFrame >= endFrame) {
                     currentTime += keyframeTime[startFrame]
                             - keyframeTime[endFrame];
                     currentFrame = startFrame + 1;
@@ -547,7 +547,7 @@
                     return true;
                 }
 
-                while (currentTime > keyframeTime[currentFrame]) {
+                while (currentTime > keyframeTime[currentFrame] && currentFrame < endFrame) {
                     currentFrame++;
                     prevFrame++;
                 }

I believe I have fixed all frame-number related issues with rev. 4525.



All sorts of frame operations work reliably now with blended and non-blended animations, all repeat modes and switching between them, changing frame numbers and even static poses while an animation runs.

Now your patch works for me, too.

Good job!