21 #ifndef PARTICLESYSTEM_H
22 #define PARTICLESYSTEM_H
24 #include "pandabase.h"
25 #include "pointerTo.h"
27 #include "pandaNode.h"
28 #include "referenceCount.h"
30 #include "pStatTimer.h"
31 #include "baseParticle.h"
32 #include "baseParticleRenderer.h"
33 #include "baseParticleEmitter.h"
34 #include "baseParticleFactory.h"
51 INLINE
void set_pool_size(
int size);
52 INLINE
void set_birth_rate(PN_stdfloat new_br);
53 INLINE
void set_soft_birth_rate(PN_stdfloat new_br);
54 INLINE
void set_litter_size(
int new_ls);
55 INLINE
void set_litter_spread(
int new_ls);
56 INLINE
void set_local_velocity_flag(
bool lv);
57 INLINE
void set_system_grows_older_flag(
bool sgo);
58 INLINE
void set_system_lifespan(PN_stdfloat sl);
59 INLINE
void set_system_age(PN_stdfloat age);
60 INLINE
void set_active_system_flag(
bool a);
61 INLINE
void set_spawn_on_death_flag(
bool sod);
62 INLINE
void set_spawn_render_node(
PandaNode *node);
63 INLINE
void set_spawn_render_node_path(
const NodePath &node);
64 INLINE
void set_template_system_flag(
bool tsf);
65 INLINE
void set_render_parent(
PandaNode *node);
66 INLINE
void set_render_parent(
const NodePath &node);
70 INLINE
void set_floor_z(PN_stdfloat z);
72 INLINE
void clear_floor_z();
74 INLINE
int get_pool_size()
const;
75 INLINE PN_stdfloat get_birth_rate()
const;
76 INLINE PN_stdfloat get_soft_birth_rate()
const;
77 INLINE
int get_litter_size()
const;
78 INLINE
int get_litter_spread()
const;
79 INLINE
bool get_local_velocity_flag()
const;
80 INLINE
bool get_system_grows_older_flag()
const;
81 INLINE PN_stdfloat get_system_lifespan()
const;
82 INLINE PN_stdfloat get_system_age()
const;
83 INLINE
bool get_active_system_flag()
const;
84 INLINE
bool get_spawn_on_death_flag()
const;
85 INLINE
PandaNode *get_spawn_render_node()
const;
86 INLINE
NodePath get_spawn_render_node_path()
const;
87 INLINE
bool get_i_was_spawned_flag()
const;
88 INLINE
int get_living_particles()
const;
89 INLINE
NodePath get_render_parent()
const;
93 INLINE PN_stdfloat get_floor_z()
const;
98 INLINE
void clear_spawn_templates();
102 INLINE
void render();
103 INLINE
void induce_labor();
104 INLINE
void clear_to_initial();
105 INLINE
void soft_stop(PN_stdfloat br = 0.0);
106 INLINE
void soft_start(PN_stdfloat br = 0.0);
107 void update(PN_stdfloat dt);
109 virtual void output(ostream &out)
const;
110 virtual void write_free_particle_fifo(ostream &out,
int indent=0)
const;
111 virtual void write_spawn_templates(ostream &out,
int indent=0)
const;
112 virtual void write(ostream &out,
int indent=0)
const;
119 bool birth_particle();
120 void kill_particle(
int pool_index);
122 void resize_pool(
int size);
126 int _particle_pool_size;
127 int _living_particles;
128 PN_stdfloat _cur_birth_rate;
129 PN_stdfloat _birth_rate;
130 PN_stdfloat _soft_birth_rate;
131 PN_stdfloat _tics_since_birth;
134 PN_stdfloat _system_age;
135 PN_stdfloat _system_lifespan;
136 PN_stdfloat _floor_z;
143 bool _template_system_flag;
151 bool _active_system_flag;
152 bool _local_velocity_flag;
153 bool _system_grows_older_flag;
157 bool _spawn_on_death_flag;
164 bool _i_was_spawned_flag;
170 static void init_type() {
171 Physical::init_type();
172 register_type(_type_handle,
"ParticleSystem",
173 Physical::get_class_type());
176 return get_class_type();
178 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
188 #include "particleSystem.I"
190 #endif // PARTICLESYSTEM_H
A basic node of the scene graph or data graph.
Pure Virtual base class for creating particles.
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.
Pure virtual particle renderer base class.
virtual void output(ostream &out=cout) const
Write a string representation of this instance to <out>.
Defines a set of physically modeled attributes.
An individual, physically-modelable particle abstract base class.
TypeHandle is the identifier used to differentiate C++ class types.
Describes a physical region in space in which particles are randomly generated.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
virtual void write(ostream &out=cout, unsigned int indent=0) const
Write a string representation of this instance to <out>.