EXTENDED setMD2Animation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
saltinbas

EXTENDED setMD2Animation

Post by saltinbas »

Hi everyone,

When you want to animate your model, what you do is to use setMD2Animation ;

modelnode->setMD2Animation (scene::EMAT_ATTACK);

When anyone uses this function, the model goes to a loop for eternity unless you swith to another animation. So for example if i fire and use attack animation, the model continues to make attack animation although i stop firing.

Here is my suggestion;

setMD2Animation function should be entented like below,

modelnode->setMD2Animation (scene::EMAT_ATTACK,number_of_loop,scene::EMAT_STAND);

this function tells that make number_of_loop times ATTACK ANIMATION AND THEN SWITH TO STAND ANIMATION.

WHAT DO YOU THINK?
cyberbobjr
Posts: 64
Joined: Mon Sep 08, 2003 8:21 am
Location: Paris, France

Post by cyberbobjr »

or better : an event raise when the animation is finished, like this :

modelnode->setMD2Animation (scene::EMAT_ATTACK,bool loop,(void*)FunctionToCall);

loop = indefinite loop or not.
FunctionToCall is the function which will be raised when animation is finished...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Hm, good idea. Especially the one with the event. I'll think about it. :)
hearsedriver
Posts: 81
Joined: Fri Aug 22, 2003 12:06 pm
Location: Germany
Contact:

Post by hearsedriver »

I'd prefer a FSM for that, so that you can have exit conditions for one state, etc.

Cheers.
matthias gall, lead programmer at sechsta sinn - email matthias@sechsta-sinn.de
Post Reply