mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
we can now perform an update on a single particle system
This commit is contained in:
parent
57ec1e52cb
commit
2425624c9d
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user