From c200a7133eaa663486dc779ef6901628ff44c5c9 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Mon, 22 Jan 2001 21:59:31 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/particlesystem/baseParticle.I | 4 +++- panda/src/particlesystem/baseParticle.h | 2 +- panda/src/particlesystem/boxEmitter.cxx | 4 ++-- panda/src/particlesystem/discEmitter.cxx | 2 +- panda/src/particlesystem/lineEmitter.cxx | 2 +- panda/src/particlesystem/particleSystem.I | 8 ++++---- panda/src/particlesystem/particleSystem.cxx | 6 +++--- panda/src/particlesystem/rectangleEmitter.cxx | 4 ++-- panda/src/particlesystem/ringEmitter.cxx | 2 +- panda/src/particlesystem/sphereSurfaceEmitter.cxx | 2 +- panda/src/particlesystem/sphereVolumeEmitter.cxx | 2 +- panda/src/particlesystem/tangentRingEmitter.cxx | 2 +- 12 files changed, 21 insertions(+), 19 deletions(-) diff --git a/panda/src/particlesystem/baseParticle.I b/panda/src/particlesystem/baseParticle.I index 705521f3ec..d9baa071c2 100644 --- a/panda/src/particlesystem/baseParticle.I +++ b/panda/src/particlesystem/baseParticle.I @@ -1,6 +1,6 @@ // Filename: BaseParticle.I // Created by: charles (16Jun00) -// +// //////////////////////////////////////////////////////////////////// INLINE void BaseParticle::set_age(float age) { @@ -28,9 +28,11 @@ INLINE bool BaseParticle::get_alive(void) const { } INLINE float BaseParticle::get_parameterized_age(void) const { + if (_lifespan <= 0) return 1.0; return _age / _lifespan; } INLINE float BaseParticle::get_parameterized_vel(void) const { + if (0 == get_terminal_velocity()) return 0.0; return (get_velocity().length()) / get_terminal_velocity(); } diff --git a/panda/src/particlesystem/baseParticle.h b/panda/src/particlesystem/baseParticle.h index e1c764febd..bb8423800c 100644 --- a/panda/src/particlesystem/baseParticle.h +++ b/panda/src/particlesystem/baseParticle.h @@ -24,7 +24,7 @@ private: LPoint3f _last_position; protected: - BaseParticle(int lifespan = 0, bool alive = false); + BaseParticle(int lifespan = 1, bool alive = false); BaseParticle(const BaseParticle ©); virtual ~BaseParticle(void); diff --git a/panda/src/particlesystem/boxEmitter.cxx b/panda/src/particlesystem/boxEmitter.cxx index 08ba3718c2..203cc5ad7e 100644 --- a/panda/src/particlesystem/boxEmitter.cxx +++ b/panda/src/particlesystem/boxEmitter.cxx @@ -13,8 +13,8 @@ BoxEmitter:: BoxEmitter(void) : BaseParticleEmitter() { - _vmin.set(0.0f, 0.0f, 0.0f); - _vmax.set(0.0f, 0.0f, 0.0f); + _vmin.set(-0.5f, -0.5f, -0.5f); + _vmax.set( 0.5f, 0.5f, 0.5f); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/particlesystem/discEmitter.cxx b/panda/src/particlesystem/discEmitter.cxx index 14ed186431..337e76fdd1 100644 --- a/panda/src/particlesystem/discEmitter.cxx +++ b/panda/src/particlesystem/discEmitter.cxx @@ -12,7 +12,7 @@ //////////////////////////////////////////////////////////////////// DiscEmitter:: DiscEmitter(void) { - _radius = 0.0f; + _radius = 1.0f; _inner_aoe = _outer_aoe = 0.0f; _inner_magnitude = _outer_magnitude = 0.0f; _cubic_lerping = false; diff --git a/panda/src/particlesystem/lineEmitter.cxx b/panda/src/particlesystem/lineEmitter.cxx index 5463031fc9..0eb948a68d 100644 --- a/panda/src/particlesystem/lineEmitter.cxx +++ b/panda/src/particlesystem/lineEmitter.cxx @@ -13,7 +13,7 @@ LineEmitter:: LineEmitter(void) : BaseParticleEmitter() { - _endpoint1.set(0.0f, 0.0f, 0.0f); + _endpoint1.set(1.0f, 0.0f, 0.0f); _endpoint2.set(0.0f, 0.0f, 0.0f); } diff --git a/panda/src/particlesystem/particleSystem.I b/panda/src/particlesystem/particleSystem.I index 6f69219b93..1298cd5ec2 100644 --- a/panda/src/particlesystem/particleSystem.I +++ b/panda/src/particlesystem/particleSystem.I @@ -1,13 +1,13 @@ // Filename: particleSystem.I // Created by: charles (14Jun00) -// +// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// // Function : render // Access : Public -// Description : Populates an atteched GeomNode structure with the -// particle geometry for rendering. This is a +// Description : Populates an attached GeomNode structure with the +// particle geometry for rendering. This is a // wrapper for accessability. //////////////////////////////////////////////////////////////////// @@ -182,7 +182,7 @@ set_render_parent(Node *node) { } _render_parent = node; - _render_arc = new RenderRelation(_render_parent, + _render_arc = new RenderRelation(_render_parent, _renderer->get_render_node()); } diff --git a/panda/src/particlesystem/particleSystem.cxx b/panda/src/particlesystem/particleSystem.cxx index a31ba09e19..3e26135eca 100644 --- a/panda/src/particlesystem/particleSystem.cxx +++ b/panda/src/particlesystem/particleSystem.cxx @@ -31,9 +31,9 @@ ParticleSystem:: ParticleSystem(int pool_size) : Physical(pool_size, false), _particle_pool_size(pool_size) { - _birth_rate = 0.0f; + _birth_rate = 0.5f; _tics_since_birth = _birth_rate; - _litter_size = 0; + _litter_size = 1; _litter_spread = 0; _living_particles = 0; _active_system_flag = true; @@ -64,7 +64,7 @@ ParticleSystem(int pool_size) : //////////////////////////////////////////////////////////////////// ParticleSystem:: ParticleSystem(const ParticleSystem& copy) : - Physical(copy), + Physical(copy), _system_age(0.0f), _template_system_flag(false) { diff --git a/panda/src/particlesystem/rectangleEmitter.cxx b/panda/src/particlesystem/rectangleEmitter.cxx index a58aab439f..90356894ac 100644 --- a/panda/src/particlesystem/rectangleEmitter.cxx +++ b/panda/src/particlesystem/rectangleEmitter.cxx @@ -13,8 +13,8 @@ RectangleEmitter:: RectangleEmitter(void) : BaseParticleEmitter() { - _vmin.set(0.0f, 0.0f); - _vmax.set(0.0f, 0.0f); + _vmin.set(-0.5f, -0.5f); + _vmax.set( 0.5f, 0.5f); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/particlesystem/ringEmitter.cxx b/panda/src/particlesystem/ringEmitter.cxx index dc1a53b508..f5dff4c28b 100644 --- a/panda/src/particlesystem/ringEmitter.cxx +++ b/panda/src/particlesystem/ringEmitter.cxx @@ -12,7 +12,7 @@ //////////////////////////////////////////////////////////////////// RingEmitter:: RingEmitter(void) : - _radius(0.0f), _aoe(0.0f) { + _radius(1.0f), _aoe(0.0f) { } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/particlesystem/sphereSurfaceEmitter.cxx b/panda/src/particlesystem/sphereSurfaceEmitter.cxx index c9b47ae1ed..fa43a246ec 100644 --- a/panda/src/particlesystem/sphereSurfaceEmitter.cxx +++ b/panda/src/particlesystem/sphereSurfaceEmitter.cxx @@ -12,7 +12,7 @@ //////////////////////////////////////////////////////////////////// SphereSurfaceEmitter:: SphereSurfaceEmitter(void) { - _radius = 0.0f; + _radius = 1.0f; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/particlesystem/sphereVolumeEmitter.cxx b/panda/src/particlesystem/sphereVolumeEmitter.cxx index 414bc7e4bf..d556c240c7 100644 --- a/panda/src/particlesystem/sphereVolumeEmitter.cxx +++ b/panda/src/particlesystem/sphereVolumeEmitter.cxx @@ -12,7 +12,7 @@ //////////////////////////////////////////////////////////////////// SphereVolumeEmitter:: SphereVolumeEmitter(void) { - _radius = 0.0f; + _radius = 1.0f; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/particlesystem/tangentRingEmitter.cxx b/panda/src/particlesystem/tangentRingEmitter.cxx index c2fd57f297..c1c12a2449 100644 --- a/panda/src/particlesystem/tangentRingEmitter.cxx +++ b/panda/src/particlesystem/tangentRingEmitter.cxx @@ -12,7 +12,7 @@ //////////////////////////////////////////////////////////////////// TangentRingEmitter:: TangentRingEmitter(void) { - _radius = 0.0f; + _radius = 1.0f; } ////////////////////////////////////////////////////////////////////