20 #ifndef PARTICLESYSTEM_H 21 #define PARTICLESYSTEM_H 49 INLINE
void set_pool_size(
int size);
50 INLINE
void set_birth_rate(PN_stdfloat new_br);
51 INLINE
void set_soft_birth_rate(PN_stdfloat new_br);
52 INLINE
void set_litter_size(
int new_ls);
53 INLINE
void set_litter_spread(
int new_ls);
54 INLINE
void set_local_velocity_flag(
bool lv);
55 INLINE
void set_system_grows_older_flag(
bool sgo);
56 INLINE
void set_system_lifespan(PN_stdfloat sl);
57 INLINE
void set_system_age(PN_stdfloat age);
58 INLINE
void set_active_system_flag(
bool a);
59 INLINE
void set_spawn_on_death_flag(
bool sod);
60 INLINE
void set_spawn_render_node(
PandaNode *node);
61 INLINE
void set_spawn_render_node_path(
const NodePath &node);
62 INLINE
void set_template_system_flag(
bool tsf);
63 INLINE
void set_render_parent(
PandaNode *node);
64 INLINE
void set_render_parent(
const NodePath &node);
68 INLINE
void set_floor_z(PN_stdfloat z);
70 INLINE
void clear_floor_z();
72 INLINE
int get_pool_size()
const;
73 INLINE PN_stdfloat get_birth_rate()
const;
74 INLINE PN_stdfloat get_soft_birth_rate()
const;
75 INLINE
int get_litter_size()
const;
76 INLINE
int get_litter_spread()
const;
77 INLINE
bool get_local_velocity_flag()
const;
78 INLINE
bool get_system_grows_older_flag()
const;
79 INLINE PN_stdfloat get_system_lifespan()
const;
80 INLINE PN_stdfloat get_system_age()
const;
81 INLINE
bool get_active_system_flag()
const;
82 INLINE
bool get_spawn_on_death_flag()
const;
83 INLINE
PandaNode *get_spawn_render_node()
const;
84 INLINE
NodePath get_spawn_render_node_path()
const;
85 INLINE
bool get_i_was_spawned_flag()
const;
86 INLINE
int get_living_particles()
const;
87 INLINE
NodePath get_render_parent()
const;
91 INLINE PN_stdfloat get_floor_z()
const;
96 INLINE
void clear_spawn_templates();
100 INLINE
void render();
101 INLINE
void induce_labor();
102 INLINE
void clear_to_initial();
103 INLINE
void soft_stop(PN_stdfloat br = 0.0);
104 INLINE
void soft_start(PN_stdfloat br = 0.0);
105 void update(PN_stdfloat dt);
107 virtual void output(std::ostream &out)
const;
108 virtual void write_free_particle_fifo(std::ostream &out,
int indent=0)
const;
109 virtual void write_spawn_templates(std::ostream &out,
int indent=0)
const;
110 virtual void write(std::ostream &out,
int indent=0)
const;
117 bool birth_particle();
118 void kill_particle(
int pool_index);
120 void resize_pool(
int size);
124 int _particle_pool_size;
125 int _living_particles;
126 PN_stdfloat _cur_birth_rate;
127 PN_stdfloat _birth_rate;
128 PN_stdfloat _soft_birth_rate;
129 PN_stdfloat _tics_since_birth;
132 PN_stdfloat _system_age;
133 PN_stdfloat _system_lifespan;
134 PN_stdfloat _floor_z;
141 bool _template_system_flag;
149 bool _active_system_flag;
150 bool _local_velocity_flag;
151 bool _system_grows_older_flag;
155 bool _spawn_on_death_flag;
162 bool _i_was_spawned_flag;
168 static void init_type() {
169 Physical::init_type();
171 Physical::get_class_type());
174 return get_class_type();
176 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
188 #endif // PARTICLESYSTEM_H PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
A lightweight class that represents a single element that may be timed and/or counted via stats.
Contains and manages a particle system.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Pure virtual particle renderer base class.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Defines a set of physically modeled attributes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An individual, physically-modelable particle abstract base class.
virtual void write(std::ostream &out=std::cout, int indent=0) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
virtual void output(std::ostream &out=std::cout) const
Write a string representation of this instance to <out>.