[FIXED] Possible bug(?) in AnimationFactory

Hello all,

I will try to demonstrate the strange behavior I noticed using AnimationFactory with the following commented lines of code:


  1. works fine - Notice the zero value of the “time” parameter:



    factory.addTimeTranslation(0, new Vector3f(20, model.getLocalTranslation().y, model.getLocalTranslation().z));


  2. produces java.lang.ArrayIndexOutOfBoundsException: -1 exception - The “time” parameter also has zero value as above.

    Also note that just before the function call I check getLocalRotation().toAngles(null)[1] & getLocalRotation().toAngles(null)[2] array elements with a System.out.print() and their value was 0.0 for both array elements, so that doesn’t seem to be the cause of the exception:



    factory.addTimeRotationAngles(0, 0, model.getLocalRotation().toAngles(null)[1], model.getLocalRotation().toAngles(null)[2]);


  3. works fine - Changed the"time" parameter to a non-zero positive value and the exception is not produced:



    factory.addTimeRotationAngles(0.1f, 0, model.getLocalRotation().toAngles(null)[1], model.getLocalRotation().toAngles(null)[2]);





    So the question is why (2) doesn’t work whilst (1) works?

You should always post the full exception, including stack trace.

Stack tracce of the exception:

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.ArrayIndexOutOfBoundsException: -1

at com.jme3.animation.AnimationFactory.addKeyFrameRotationAngles(AnimationFactory.java:280)

at com.jme3.animation.AnimationFactory.addTimeRotationAngles(AnimationFactory.java:258)

at JMECinematicWrapper.AddOrientation_X_Event(JMECinematicWrapper.java:285)

at BallScript.simpleInitApp(BallScript.java:38)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:231)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)

at java.lang.Thread.run(Thread.java:722)

This issue is already fixed in nightly builds.

You’ll have to wait for next stable until it works i’m afraid.

Until then use your 0.1f time workaround

In the same context, I noticed that for some angle values not even 0.1f value is valid (e.g.it has to be 0.5f). Do you think this is part of the same bug?

Is there an estimation about when the next stable is being released?

@yannischris said:
Is there an estimation about when the next stable is being released?


It'll be released when it's ready. In Valve's Time.

@madjack: What is “valve’s time”?

That might help you to get what is Valve Time. :wink:



http://www.totalgamingreviews.com/2011/02/what-is-valve-time/

@madjack: I checked out that link but it didn’t answer my question.

It means that any release will be ready when it’s ready. Not before, not after. Giving any kind of date might result in it being late or early. If it’s late people will whine because we said it’d be release at X date and it’s not…

@madjack: What you are saying is too obvious to me to ask about. That’s why I just asked for a time estimation, as in “time scale” (e.g. a week vs. a month vs. a year), so that I can figure out what implementation plan to follow.



Anyway the post got out of context (for no particular reason), so I re-state my main question (mainly @nehon who replied to the post so far):

In the same context, I noticed that for some angle values not even 0.1f value is valid (e.g.it has to be 0.5f). Do you think this is part of the same bug?

@yannischris said:
In the same context, I noticed that for some angle values not even 0.1f value is valid (e.g.it has to be 0.5f). Do you think this is part of the same bug?

I don't get what you mean by "valid" value.

Excuse me, I was too much in context :wink:

By “valid” I meant that the angle value doesn’t cause the ArrayIndexOutOfBoundsException I mentioned above.

I can’t get the exception with any value against the last SVN so i guess it was related yes

@nehon: OK, thanks!