How to delete particles in a ParticleInfluence?

In jme2 I use a class extending ParticleInfluence that sets particles to Status.Dead on collision. At least with the latest SVN code affected particles will stop move and rotate but still be visible.

Is this a bug or should I do something else to remove/recycle them?

try setting the particle's color alpha to 0.

Using particle.getCurrentColor().a = 0 and setting it to Dead doesn't help as the particle is not updated.

If I don't set it to Dead the color values will be overwritten and the particle continues to move.



The next thing I tried is:

particle.getPosition().set(0,0,0);

particle.getCurrentColor().a = 0;

particle.recreateParticle(0);



I hoped it will be set to the start position and wait for the respawn, but that doesn't work either.

I'll expose the functionality currently performed by the Particle for hiding it on death and you can call that.

Sounds good.

The last thing I tried is: set position to 0, call recreateParticle and set the status to Alive. That will disturb a controlled flow but at least it looks OK. :wink:

Ok, it's up in svn… Particle has a killParticle method which will shrink the verts of the particle to an infinitely small polygon and set the color for those verts to have an alpha of 0.