A question about animator

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
analize999
Posts: 12
Joined: Mon Jun 30, 2008 11:35 pm
Location: VietNam

A question about animator

Post by analize999 »

Hi, I’m newer using irrlicht. I have a question: In irrlicht, all animations of meshs can easily verify the completion by a function callback. When a animation was done, the engine auto calls a fuction callback and I can use it to verify the completion of animation. But with animator, it doesn’t have. The engine doesn’t have any function to verify the completion of animator. For example, when I created an animator fly straight by function createFlyStaightAnimator with option loop = false and attach it into animation mesh. I don’t know how to verify the flying of mesh was done. I just only one way: the position of mesh in space. But with animation mesh, the position of mesh don’t fix, so I verified an area in space – It is hard to program. Please help me?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You could edit the irrlicht source and add in a callback system if you felt adventurous enough.

Alternatively just check the mesh's position each frame, compared to the ending point of the animator and when they become equal (or sufficiently close) you know the animation has finished.

Or i suppose you could just check the mesh's previous position against its current position and when they're equal you know it's not moving anymore, hence the animation has finished.
Image Image Image
analize999
Posts: 12
Joined: Mon Jun 30, 2008 11:35 pm
Location: VietNam

Post by analize999 »

Thank you very much for your answer. But this only applies for static mesh. If you have an animation mesh such as a running horse, the horse's position doesn't fix when the animator has finished. It always oscillates in an area in space, so I must check an area in space. But with other animations, each animation has another oscillation in space. So I don't know how to check.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

"It is hard to program"

The path to the dark side.

anyway...

you should have a flag telling it's done?

this should be obvious, how come the animator stopped animating if you set it up as a one-shot animator?

<slaps me forehead twice>
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

analize999 wrote:Thank you very much for your answer. But this only applies for static mesh. If you have an animation mesh such as a running horse, the horse's position doesn't fix when the animator has finished. It always oscillates in an area in space, so I must check an area in space. But with other animations, each animation has another oscillation in space. So I don't know how to check.
Are you sure? That's rather strange as the position of a node shouldn't change based on its animation.
Image Image Image
analize999
Posts: 12
Joined: Mon Jun 30, 2008 11:35 pm
Location: VietNam

Post by analize999 »

Ooh, you say truth. The position is independent with animation. Because my program has a few errors, and I misunderstood this errors cause of animation mesh's position. Thank for your help![/quote]
Post Reply