25 _renderer->render(_physics_objects, _living_particles);
37 _tics_since_birth = _cur_birth_rate;
52 for(i = 0; i < (int)_physics_objects.size(); i++) {
58 _tics_since_birth = 0.0f;
71 _cur_birth_rate = _birth_rate;
72 _tics_since_birth = 0.0f;
85 set_soft_birth_rate(br);
86 _cur_birth_rate = _soft_birth_rate;
87 _tics_since_birth = 0.0f;
99 INLINE
void ParticleSystem::
100 set_pool_size(
int size) {
109 INLINE
void ParticleSystem::
110 set_birth_rate(PN_stdfloat new_br) {
111 _birth_rate = new_br;
112 _cur_birth_rate = _birth_rate;
113 if(IS_NEARLY_ZERO(_birth_rate)) _birth_rate = NEARLY_ZERO(PN_stdfloat);
121 INLINE
void ParticleSystem::
122 set_soft_birth_rate(PN_stdfloat new_br) {
123 _soft_birth_rate = new_br;
124 if(IS_NEARLY_ZERO(_soft_birth_rate)) _soft_birth_rate = NEARLY_ZERO(PN_stdfloat);
132 INLINE
void ParticleSystem::
133 set_litter_size(
int new_ls) {
134 _litter_size = new_ls;
141 INLINE
void ParticleSystem::
142 set_litter_spread(
int new_ls) {
143 _litter_spread = new_ls;
150 INLINE
void ParticleSystem::
153 _renderer->resize_pool(_particle_pool_size);
156 _render_node_path = _renderer->get_render_node_path();
164 INLINE
void ParticleSystem::
173 INLINE
void ParticleSystem::
175 int pool_size = _particle_pool_size;
179 set_pool_size(pool_size);
186 INLINE
void ParticleSystem::
187 set_floor_z(PN_stdfloat z) {
195 INLINE
void ParticleSystem::
196 set_active_system_flag(
bool a) {
197 _active_system_flag = a;
204 INLINE
void ParticleSystem::
205 set_local_velocity_flag(
bool lv) {
206 _local_velocity_flag = lv;
213 INLINE
void ParticleSystem::
214 set_spawn_on_death_flag(
bool sod) {
215 _spawn_on_death_flag = sod;
222 INLINE
void ParticleSystem::
223 set_system_grows_older_flag(
bool sgo) {
224 _system_grows_older_flag = sgo;
232 INLINE
void ParticleSystem::
233 set_system_lifespan(PN_stdfloat sl) {
234 _system_lifespan = sl;
242 INLINE
void ParticleSystem::
243 set_system_age(PN_stdfloat age) {
251 INLINE
void ParticleSystem::
253 set_spawn_render_node_path(
NodePath(node));
260 INLINE
void ParticleSystem::
261 set_spawn_render_node_path(
const NodePath &node) {
262 _spawn_render_node_path = node;
269 INLINE
void ParticleSystem::
278 INLINE
void ParticleSystem::
279 set_render_parent(
const NodePath &node) {
282 _render_parent = node;
283 _render_node_path = _renderer->get_render_node_path();
292 INLINE
void ParticleSystem::
293 set_template_system_flag(
bool tsf) {
294 _template_system_flag = tsf;
301 INLINE
void ParticleSystem::
303 _spawn_templates.push_back(ps);
310 INLINE
void ParticleSystem::
311 clear_spawn_templates() {
312 _spawn_templates.erase(_spawn_templates.begin(),
313 _spawn_templates.end());
320 INLINE
void ParticleSystem::
322 _floor_z = -HUGE_VAL;
333 INLINE
int ParticleSystem::
334 get_pool_size()
const {
335 return _particle_pool_size;
342 INLINE PN_stdfloat ParticleSystem::
343 get_birth_rate()
const {
351 INLINE PN_stdfloat ParticleSystem::
352 get_soft_birth_rate()
const {
353 return _soft_birth_rate;
360 INLINE
int ParticleSystem::
361 get_litter_size()
const {
369 INLINE
int ParticleSystem::
370 get_litter_spread()
const {
371 return _litter_spread;
379 get_renderer()
const {
388 get_emitter()
const {
397 get_factory()
const {
405 INLINE PN_stdfloat ParticleSystem::
406 get_floor_z()
const {
414 INLINE
int ParticleSystem::
415 get_living_particles()
const {
416 return _living_particles;
423 INLINE
bool ParticleSystem::
424 get_active_system_flag()
const {
425 return _active_system_flag;
432 INLINE
bool ParticleSystem::
433 get_local_velocity_flag()
const {
434 return _local_velocity_flag;
441 INLINE
bool ParticleSystem::
442 get_spawn_on_death_flag()
const {
443 return _spawn_on_death_flag;
450 INLINE
bool ParticleSystem::
451 get_system_grows_older_flag()
const {
452 return _system_grows_older_flag;
459 INLINE PN_stdfloat ParticleSystem::
460 get_system_lifespan()
const {
461 return _system_lifespan;
468 INLINE PN_stdfloat ParticleSystem::
469 get_system_age()
const {
477 INLINE
bool ParticleSystem::
478 get_i_was_spawned_flag()
const {
479 return _i_was_spawned_flag;
487 get_spawn_render_node()
const {
488 return _spawn_render_node_path.
node();
496 get_spawn_render_node_path()
const {
497 return _spawn_render_node_path;
505 get_render_parent()
const {
506 return _render_parent;
A basic node of the scene graph or data graph.
Pure Virtual base class for creating particles.
void induce_labor()
Forces the birth of a particle litter this frame by resetting _tics_since_birth.
PandaNode * node() const
Returns the referenced node of the path.
void clear_physics_objects()
Erases the object list.
Contains and manages a particle system.
void soft_start(PN_stdfloat br=0.0)
Causes system to use birth rate set by set_birth_rate()
void reparent_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
Removes the referenced node of the NodePath from its current parent and attaches it to the referenced...
Pure virtual particle renderer base class.
void soft_stop(PN_stdfloat br=0.0)
Causes system to use birth rate set by set_soft_birth_rate()
void clear_to_initial()
Resets the system to its start state by resizing to 0, then resizing back to current size...
An individual, physically-modelable particle abstract base class.
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
void render()
Populates an attached GeomNode structure with the particle geometry for rendering.
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...