Particle systems and clearing the emission thereof

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
lazerblade
Posts: 194
Joined: Thu Mar 18, 2010 3:31 am
Contact:

Particle systems and clearing the emission thereof

Post by lazerblade »

Okay I'm not sure if this is a "beginners question" as I consider particle
systems to be more advanced. But what I'm trying to do is rather simple
and I'm surprised that I was unable to find the answer in the tutorials or
on the forums with a search.

Here's the problem.
I can't find a way to effectively clear or reset the particle emissions of
a given particle system. This means that when I fire a gun the projectile of
which has a particle system attached, wait for it to hit the wall, and then fire
again, some of the old particles which were still there and were just invisible
reappear and go on.

I've tried doing a 'particleSystem->setEmitter(0)' along with a handful
of other things, but I cannot find a way to clear or even kill the particles
of a particle system.

I'm hoping there's something like 'particleSystem->clearParticleEmission()'
or something like that...
LazerBlade

When your mind is racing, make sure it's not racing in a circle.

3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
lazerblade
Posts: 194
Joined: Thu Mar 18, 2010 3:31 am
Contact:

Post by lazerblade »

BUMP!!! :wink:

Come on, am I really the only person who has ever thought of doing such
a thing? If anybody has advice or solutions, I'm all ears.
LazerBlade

When your mind is racing, make sure it's not racing in a circle.

3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
CuteAlien
Admin
Posts: 9953
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, forgot to answer this. Right now it's really a problem. I remember I patched that a few years ago in own code, but it's not yet in the engine (and the patch wasn't good as I just hacked in to clear it always on setvisible). It's a missing features that we have to add.
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
lazerblade
Posts: 194
Joined: Thu Mar 18, 2010 3:31 am
Contact:

Post by lazerblade »

Ahh, I thought as much. I'm sure Irrlicht will do it eventually. :lol:

In the meantime, I'm trying to patch it myself. I have no idea where to start,
so advice would again be helpful.
LazerBlade

When your mind is racing, make sure it's not racing in a circle.

3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
easy
Posts: 14
Joined: Thu Dec 09, 2010 11:14 am
Location: Hungary

Post by easy »

The way I did this, I attched a fade out animator to the particle system, and also added a timed auto delete animator (I forgot it's name). So I could handle explosions.
CuteAlien
Admin
Posts: 9953
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

@lazerblade: When you're not afraid of changing engine sources - all you have to do there is probably add a function to CParticleSystemSceneNode that calls Particles.set_used(0). I try to get to at the weekend (I just have to write a small test first to make sure this really works in all cases).
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
CuteAlien
Admin
Posts: 9953
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

IParticleSceneNode:clearParticles is now in svn trunk.
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
lazerblade
Posts: 194
Joined: Thu Mar 18, 2010 3:31 am
Contact:

Post by lazerblade »

Awesomeness, Thanks! :D
LazerBlade

When your mind is racing, make sure it's not racing in a circle.

3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
Post Reply