Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/particlesystem/baseParticle.h

Go to the documentation of this file.
00001 // Filename: baseParticle.h
00002 // Created by:  charles (14Jun00)
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 #ifndef BASEPARTICLE_H
00020 #define BASEPARTICLE_H
00021 
00022 #include <pandabase.h>
00023 #include <physicsObject.h>
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : BaseParticle
00027 // Description : An individual, physically-modelable particle
00028 //               abstract base class.
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_PANDAPHYSICS BaseParticle : public PhysicsObject {
00031 private:
00032   // NOTE: age and lifespan are in seconds.
00033   float _age;
00034   float _lifespan;
00035   bool _alive;
00036 
00037   LPoint3f _last_position;
00038 
00039 protected:
00040   BaseParticle(int lifespan = 1, bool alive = false);
00041   BaseParticle(const BaseParticle &copy);
00042   virtual ~BaseParticle(void);
00043 
00044 public:
00045 
00046   // local methods
00047   INLINE void set_age(float age);
00048   INLINE void set_lifespan(float lifespan);
00049   INLINE void set_alive(bool alive);
00050 
00051   INLINE float get_age(void) const;
00052   INLINE float get_lifespan(void) const;
00053   INLINE bool get_alive(void) const;
00054 
00055   INLINE float get_parameterized_age(void) const;
00056   INLINE float get_parameterized_vel(void) const;
00057 
00058   // child methods
00059   virtual void init(void) = 0;
00060   virtual void die(void) = 0;
00061   virtual void update(void) = 0;
00062 
00063   // for spriteParticleRenderer
00064   virtual float get_theta(void) const;
00065 
00066   // from PhysicsObject
00067   virtual PhysicsObject *make_copy(void) const = 0;
00068 };
00069 
00070 #include "baseParticle.I"
00071 
00072 #endif // BASEPARTICLE_H

Generated on Fri May 2 00:40:54 2003 for Panda by doxygen1.3