we can now perform an update on a single particle system

This commit is contained in:
Josh Wilson 2006-07-20 14:52:39 +00:00
parent 57ec1e52cb
commit 2425624c9d
2 changed files with 27 additions and 0 deletions

View File

@ -127,6 +127,32 @@ do_particles(float dt) {
// 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
// Access : Public

View File

@ -44,6 +44,7 @@ PUBLISHED:
INLINE void clear();
void do_particles(float dt);
void do_particles(float dt, ParticleSystem * ps, bool do_render = true);
virtual void output(ostream &out) const;
virtual void write_ps_list(ostream &out, int indent=0) const;