The advanced particle system we are writing has two external functions that can be called from the JavaScript in our app. These functions, add_emitter, and update_emitter, are called to either insert or modify the particle system in the WebAssembly module. The advanced_particle.cpp file contains these functions, as well as the main function, which is called when the Module is loaded, and the show_emission function, which is called once per frame render. We will not need to modify the main and the show_emission functions from what we created for the basic particle system earlier in this chapter. We will, however, need to add the additional parameters we put into our JavaScript code to add_emitter and update_emitter. Also, we have created a utility function called get_random_float, which we use when spawning particles. Because this file contains all of our other...





















































