I'm dealing with MD2 animated meshes, and here is my "problem" :
I have a character which can hit others with a bat. Therefore, it has two named animations : "hit_begin" and "hit_end". The first one begins with the character's arm up, and ends with the arm down. The second one is off course the opposite. I'm playing both the animations with callbacks mechanism, and that works quite good.
My present problem is the following : when loading the mesh to irrlicht, it generates interpolated frames, so that the animation can be looped. But when I use setMD2Animation, every interpolated frame of the animation is played, even the 3 last frames, which make the arm "jump" because its position is not the same at the end and at the beginning of the animation.
I can fix this problem by getting the frames corresponding to the specified animation, and then use setFrameLoop to play every frame but the last 3. That works fine, but it does not appear clean to me.
I then suggest to add an argument to the setMD2Animation method, to specify if the last 3 frames are to be displayed :
Code: Select all
virtual bool setMD2Animation (const c8 *animationName)=0
->
virtual bool setMD2Animation (const c8 *animationName, bool isLoopingAnimation=true)=0
I then would like to know if this idea is good, or if someone has an other "clean" idea to do the same thing.
I can provide a patch to implement this if necessary, the changes would not be enormous...
Thanks for your answers !