00001 // Filename: baseParticle.I 00002 // Created by: charles (16Jun00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 INLINE void BaseParticle::set_age(float age) { 00020 _age = age; 00021 } 00022 00023 INLINE void BaseParticle::set_lifespan(float lifespan) { 00024 _lifespan = lifespan; 00025 } 00026 00027 INLINE void BaseParticle::set_alive(bool alive) { 00028 _alive = alive; 00029 } 00030 00031 INLINE float BaseParticle::get_age(void) const { 00032 return _age; 00033 } 00034 00035 INLINE float BaseParticle::get_lifespan(void) const { 00036 return _lifespan; 00037 } 00038 00039 INLINE bool BaseParticle::get_alive(void) const { 00040 return _alive; 00041 } 00042 00043 INLINE float BaseParticle::get_parameterized_age(void) const { 00044 if (_lifespan <= 0) return 1.0; 00045 return _age / _lifespan; 00046 } 00047 00048 INLINE float BaseParticle::get_parameterized_vel(void) const { 00049 if (IS_NEARLY_ZERO(get_terminal_velocity())) return 0.0; 00050 return (get_velocity().length()) / get_terminal_velocity(); 00051 }