Panda3D
 All Classes Functions Variables Enumerations
particleSystemManager.h
1 // Filename: particleSystemManager.h
2 // Created by: charles (28Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PARTICLESYSTEMMANAGER_H
16 #define PARTICLESYSTEMMANAGER_H
17 
18 #include "pandabase.h"
19 #include "plist.h"
20 #include "particleSystem.h"
21 #include "pStatCollector.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : ParticleSystemManager
25 // Description : Manages a set of individual ParticleSystem objects,
26 // so that each individual one doesn't have to be
27 // updated and rendered every frame
28 // See Also : particleSystemManager.cxx
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAPHYSICS ParticleSystemManager {
31 PUBLISHED:
32  ParticleSystemManager(int every_nth_frame = 1);
33  virtual ~ParticleSystemManager();
34 
35  INLINE void set_frame_stepping(int every_nth_frame);
36  INLINE int get_frame_stepping() const;
37 
38  INLINE void attach_particlesystem(ParticleSystem *ps);
39  void remove_particlesystem(ParticleSystem *ps);
40  INLINE void clear();
41 
42  void do_particles(PN_stdfloat dt);
43  void do_particles(PN_stdfloat dt, ParticleSystem * ps, bool do_render = true);
44 
45  virtual void output(ostream &out) const;
46  virtual void write_ps_list(ostream &out, int indent=0) const;
47  virtual void write(ostream &out, int indent=0) const;
48 
49 private:
51 
52  int _nth_frame;
53  int _cur_frame;
54 
55  static PStatCollector _do_particles_collector;
56 };
57 
58 #include "particleSystemManager.I"
59 
60 #endif // PARTICLESYSTEMMANAGER_H
Manages a set of individual ParticleSystem objects, so that each individual one doesn't have to be up...
A lightweight class that represents a single element that may be timed and/or counted via stats...
Contains and manages a particle system.