|
@@ -127,6 +127,32 @@ do_particles(float dt) {
|
|
|
// cout << "ParticleSystemManager::doparticles exiting." << endl;
|
|
// cout << "ParticleSystemManager::doparticles exiting." << endl;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function : do_particles
|
|
|
|
|
+// Access : public
|
|
|
|
|
+// Description : does an update and render for each ps in the list.
|
|
|
|
|
+// this is probably the one you want to use. Rendering
|
|
|
|
|
+// is the expensive operation, and particles REALLY
|
|
|
|
|
+// should at least be updated every frame, so nth_frame
|
|
|
|
|
+// stepping applies only to rendering.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void ParticleSystemManager::
|
|
|
|
|
+do_particles(float dt, ParticleSystem *ps, bool do_render) {
|
|
|
|
|
+ if (ps->get_active_system_flag() == true) {
|
|
|
|
|
+ ps->update(dt);
|
|
|
|
|
+ // Handle age:
|
|
|
|
|
+ if (ps->get_system_grows_older_flag() == true) {
|
|
|
|
|
+ float age = ps->get_system_age() + dt;
|
|
|
|
|
+ ps->set_system_age(age);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // handle render
|
|
|
|
|
+ if (do_render) {
|
|
|
|
|
+ ps->render();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function : output
|
|
// Function : output
|
|
|
// Access : Public
|
|
// Access : Public
|