What are Events and Event Handlers?
As we write complex particle systems, for them to work, we will need to have multiple emitters in a system interact with each other. For example, when creating a firework effect, when the particles that streak into the sky from the ground die, they should spawn a secondary sparkling effect. With raindrops, when each water particle hits the ground, it should spawn a splashing particle effect. Events and Event Handlers enable us to achieve these kinds of effects. Particles generate specific Events that occur in the lifetime of the particle. Event Handlers listen for those Events and respond to them. The response may be in the form of property or behavior changes or the spawning of particles. For example, in the case of raindrop effects, the water particle, on hitting the ground, generates a Collision event. This triggers the Event Handler to spawn secondary particles, which create a splashing effect.
Events work only with CPU simulations. We also...