Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
480 stars 22 forks source link

Particle died event #44

Closed marwie closed 1 month ago

marwie commented 1 year ago

Hello,

is there a good way to get the died state of a particle from a behaviour? How should events be implemented that happen on particle death?

My workaround for now is adding the current delta time and checking if it is above the life. But that is quite hacky and unstable I would say :)

const willDie = particle.age + delta >= particle.life

Alchemist0823 commented 1 year ago

Hi marwie, thanks for the suggestion. This is something we definitely want to consider. we could implement an event callback for that. I will keep you updated.

Alchemist0823 commented 1 month ago

implemented "particleDied" event with b12ce575c73f2be7304f5c6c23e527ae9e9fa74b use addEventListener to listen.