You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking over ParticleGenerator and the particle example reveal several wrinkles that I think should be fixed.
Perhaps I'm overthinking the role of the particle generator here, but presently in the particle example it seems almost completely unused.
ParticleGenerator
generate_per_ms and remaining_ms are currently unused?
Should ParticleGenerator be managed by the engine in the same way that Timers/Tweens are?
Should ParticleGenerator not include separate generate, update and render functions?
It feels like ParticleGenerator should handle expiring old particles and calling the necessary function to generate new ones, but then call out to an anonymous function for the "update remaining particles" portion of its functionality.
Perhaps update should be update_particle and render should be render_particle and these user functions can then only have to worry about operating upon a single particle:
// update remaining particlesfor (auto p : particles) {
update_particle(p); // Call out to user supplied function
p->age_ms += elapsed_ms;
p->age = p->age_ms / float(lifetime_ms);
}
Particle Example
How do rain_generate, rain, generate_basic_rain and basic_rain_generator interplay. Why so many named functions?
Why is only basic_rain_generator's update function called?
Why do spark(), smoke() and rain() not exist as update and render functions on the ParticleGenerator itself?
I would expect the code to feel something like this:
Looking over ParticleGenerator and the particle example reveal several wrinkles that I think should be fixed.
Perhaps I'm overthinking the role of the particle generator here, but presently in the particle example it seems almost completely unused.
ParticleGenerator
generate_per_ms
andremaining_ms
are currently unused?ParticleGenerator
be managed by the engine in the same way that Timers/Tweens are?ParticleGenerator
not include separategenerate
,update
andrender
functions?It feels like
ParticleGenerator
should handle expiring old particles and calling the necessary function to generate new ones, but then call out to an anonymous function for the "update remaining particles" portion of its functionality.Perhaps
update
should beupdate_particle
andrender
should berender_particle
and these user functions can then only have to worry about operating upon a single particle:Particle Example
rain_generate
,rain
,generate_basic_rain
andbasic_rain_generator
interplay. Why so many named functions?basic_rain_generator
'supdate
function called?spark()
,smoke()
andrain()
not exist asupdate
andrender
functions on the ParticleGenerator itself?I would expect the code to feel something like this:
The text was updated successfully, but these errors were encountered: