00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PARTICLESYSTEMMANAGER_H
00016 #define PARTICLESYSTEMMANAGER_H
00017
00018 #include "pandabase.h"
00019 #include "plist.h"
00020 #include "particleSystem.h"
00021 #include "pStatCollector.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDAPHYSICS ParticleSystemManager {
00031 PUBLISHED:
00032 ParticleSystemManager(int every_nth_frame = 1);
00033 virtual ~ParticleSystemManager();
00034
00035 INLINE void set_frame_stepping(int every_nth_frame);
00036 INLINE int get_frame_stepping() const;
00037
00038 INLINE void attach_particlesystem(ParticleSystem *ps);
00039 void remove_particlesystem(ParticleSystem *ps);
00040 INLINE void clear();
00041
00042 void do_particles(PN_stdfloat dt);
00043 void do_particles(PN_stdfloat dt, ParticleSystem * ps, bool do_render = true);
00044
00045 virtual void output(ostream &out) const;
00046 virtual void write_ps_list(ostream &out, int indent=0) const;
00047 virtual void write(ostream &out, int indent=0) const;
00048
00049 private:
00050 plist< PT(ParticleSystem) > _ps_list;
00051
00052 int _nth_frame;
00053 int _cur_frame;
00054
00055 static PStatCollector _do_particles_collector;
00056 };
00057
00058 #include "particleSystemManager.I"
00059
00060 #endif // PARTICLESYSTEMMANAGER_H