A question about animator
-
- Posts: 12
- Joined: Mon Jun 30, 2008 11:35 pm
- Location: VietNam
A question about animator
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?
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.
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.
-
- Posts: 12
- Joined: Mon Jun 30, 2008 11:35 pm
- Location: VietNam
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.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.
-
- Posts: 12
- Joined: Mon Jun 30, 2008 11:35 pm
- Location: VietNam