The example is based on the
03-Particles/01-SingleParticle project, implemented in the previous section. We implement the emitter right inside the
testApp class. In the class declaration, replace the following line with declaration of a single particle
Particle p; with an array of particles:
vector<Particle> p; //Particles
We will delete inactive particles from any parts of the
p array. So for computational efficiency, it is preferable to use the
deque class instead of
vector. But for simplicity, in this example, we use
vector. It works fast enough for our purposes in the example.
See usage of
deque in the Radial slit-scan example section in Chapter 5, Working with Videos.
float bornRate; //Particles born rate per...