OgreXml animation with RT_CLAMP exception

Class: com.jmex.model.ogrexml.anim.BoneTrack



Source, row 129:

            for (int i = 0; i < times.length; i++){

                if (times <= time){

                    startFrame = i;

                    endFrame  = i + 1;

                    //assert times[startFrame] < times[endFrame];

                }

            }



For example

times.length = 4

times[3] = 1.6

time = 1.6



Result:

startFrame = 3

endFrame = 4  <- Out of range



Exception: IndexOutOfBoundsException



FIXED:

Class: com.jmex.model.ogrexml.anim.BoneTrack



Row: 135



            float blend = 0.0f;

            if (endFrame < times.length) {

                blend = (time - times[startFrame]) / (times[endFrame] - times[startFrame]);

            }

This issue was fixed recently in jME2 SVN, the else if statement above checks with >= instead of >:

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/com/jmex/model/ogrexml/anim/BoneTrack.java#114


time >= times[times.length-1]


times[times.length-1] = times[3] = 1.6 in your case so it checks
1.6 >= 1.6 is true and the proper transforms are set and no exceptions happen.

thx