How to restart MD5 animation?

Hi, i'm trying to play a shooting animation when a bullet is fired.

I'm using Neakor's md5importer to load and play my animations.



If I set the controllers repeatType to RT_CLAMP then the animation is played only once, but I need to restart it each time a bullet is fired.



How to do that?

Please somebody help me out. I really dont know how to replay the same animation when the controller is Controller.RT_CLAMP. Or do I have to make my custom controller?



If you dont understand what I am trying to ask then at least tell me that you dont understand what the heck I'm talking about and I'll try to explain more.

Have you tried with controller.setTime(0) or something like that?

Tx for reply but the contoller doesent have this method, it only has setMinTime(float f) and setMaxTime(float f)

wow i have no idea why hardly anyone has replied to your previous comments but shouldn't it be RT_CYCLE RT_CLAMP leaves it at its final state look at the code snippet below found at the top of Controller.java


 /**
     * A clamped repeat type signals that the controller should look like its
     * final state when it's done <br>
     * Example: 0 1 5 8 9 10 10 10 10 10 10 10 10 10 10 10...
     */
    public static final int RT_CLAMP = 0;

    /**
     * A wrapped repeat type signals that the controller should start back at
     * the begining when it's final state is reached <br>
     * Example: 0 1 5 8 9 10 0 1 5 8 9 10 0 1 5 ....
     * 
     */
    public static final int RT_WRAP = 1;

    /**
     * A cycled repeat type signals that the controller should cycle it's states
     * forwards and backwards <br>
     * Example: 0 1 5 8 9 10 9 8 5 1 0 1 5 8 9 10 9 ....
     */
    public static final int RT_CYCLE = 2;

Yes RT_CLAMP leaves it at the final state, but RT_CYCLE keeps playing the animation over and over again. I need to play the shooting animation each time the bullet is fired. How can I do that?



Do I have to somehow reset the controller?

Henri said:

Yes RT_CLAMP leaves it at the final state, but RT_CYCLE keeps playing the animation over and over again. I need to play the shooting animation each time the bullet is fired. How can I do that?

Do I have to somehow reset the controller?


is it a type of recoil aniamtion..Is it longer than it takes each bullet to be fired...You could try resetting the animation with each bullet fired directly

I think MD5Animation.reset() is what you are looking for.

Yes the reset() does the trick. thanx guys, especially nymon for pointing out the exact method. I didnt find it own my own since I was only looking MD5Node and Controller classes and yes it is a recoil animation for pistol.