"make emitter stop emitting" 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
andreee
Posts: 43
Joined: Thu Feb 09, 2006 11:13 am
Location: Prague

"make emitter stop emitting" animator

Post by andreee »

Hello, is there an animator way to do this? Because if i add delete animator to the particleSystemSceneNode, it kill all the particles (what i want is the emitter to stop emitting and when the last particle dies, i kill the whole node).
Is it possible somehow? I searched the forum, but din't find a solution.

Thank you :)
Dreaming of folk-art at http://www.ambersky.cz
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I suppose the following could work mostly (untested):

Code: Select all

particleSceneNode->getEmitter ()->setMaxParticlesPerSecond(0);
particleSceneNode->getEmitter ()->setMinParticlesPerSecond 
It won't remove the node, you would still have to do that if it's necessary as well (maybe with a timer).

edit: Or some hack - you could then add a custom IParticleAffector which would get the amount of active particles in it's affect function. So you could figure out in there if there are no particles left.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

what about IParticleSystemSceneNode->setEmitter(0); ?
or will that kill the particles?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
andreee
Posts: 43
Joined: Thu Feb 09, 2006 11:13 am
Location: Prague

Post by andreee »

Yes, that would work, however by the time the emmiter gets to be destroyed, whole bunch of new emitters+particleNodes are created, so it would be uncomfortable to keep track of all existing particleNodes+their emmiters, since they all would have same lifetime.. Maybe some sort of custom animator..
Dreaming of folk-art at http://www.ambersky.cz
Post Reply