mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
changed to -HUGE_VAL as drose suggested; added clear_floor_z
This commit is contained in:
parent
a3cf589261
commit
a0d7a72b5e
@ -242,6 +242,15 @@ clear_spawn_templates() {
|
||||
_spawn_templates.end());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function : clear_floor_z
|
||||
// Access : Public
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ParticleSystem::
|
||||
clear_floor_z() {
|
||||
_floor_z = -HUGE_VAL;
|
||||
}
|
||||
|
||||
//// /////////////////////////////////////////////////////
|
||||
//// GET METHODS /////////////////////////////////////////////////////
|
||||
//// /////////////////////////////////////////////////////
|
||||
|
@ -55,7 +55,7 @@ ParticleSystem(int pool_size) :
|
||||
_system_lifespan = 0.0f;
|
||||
_i_was_spawned_flag = false;
|
||||
_particle_pool_size = 0;
|
||||
_floor_z = _FPCLASS_NINF;
|
||||
_floor_z = -HUGE_VAL;
|
||||
|
||||
// just in case someone tries to do something that requires the
|
||||
// use of an emitter, renderer, or factory before they've actually
|
||||
@ -512,7 +512,7 @@ update(float dt) {
|
||||
//cerr<<"bp->get_position().get_z() returning "<<bp->get_position().get_z()<<endl;
|
||||
if (age >= bp->get_lifespan()) {
|
||||
kill_particle(current_index);
|
||||
} else if (get_floor_z() != _FPCLASS_NINF
|
||||
} else if (get_floor_z() != -HUGE_VAL
|
||||
&& bp->get_position().get_z() <= get_floor_z()) {
|
||||
// ...the particle is going under the floor.
|
||||
// Maybe tell the particle to bounce: bp->bounce()?
|
||||
|
@ -71,6 +71,8 @@ PUBLISHED:
|
||||
INLINE void set_factory(BaseParticleFactory *f);
|
||||
INLINE void set_floor_z(float z);
|
||||
|
||||
INLINE void clear_floor_z();
|
||||
|
||||
INLINE int get_pool_size() const;
|
||||
INLINE float get_birth_rate() const;
|
||||
INLINE int get_litter_size() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user