SceneNode Animator - plays once, and then?

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
GnarlyHotep
Posts: 10
Joined: Tue Aug 14, 2007 6:35 pm

SceneNode Animator - plays once, and then?

Post by GnarlyHotep »

I'm getting ready to work on creating some autonomous objects that can wander around a map. I want to tie them into an AI that can select paths and so on. My first idea for integrating it with the scene graph was to apply an animator (like a fly straight animator) that runs once to an animated mesh node. After the object reaches its waypoint, the AI will pick a new destination. This gets me to my two questions:

First, what happens to an animator that is set to play once, once it finishes playing? Is it still attached to the node, but inactive? If it is, and I then attach another animator to that node, does the expired animator get cleaned up, or is there something I need to do manually to prevent leaks? Or do the expired animators persist until the parent node is destroyed?

Second, will I need to write my own animator that can call a callback when it finishes playing, or is there already one out there?

TIA
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I believe the animators will clean themselves up once they're finished with.

There are no animators with callbacks and lots of people have asked to know when they've finished animating. If you think you can write your own animator then that's great and if you could share it with others here then that's even better! Although you don't really need to write a new animator as you just need to (each frame) check to see if you're close enough (to within a couple of units probably) to your destination.
Image Image Image
Post Reply