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