00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BASEPARTICLE_H
00020 #define BASEPARTICLE_H
00021
00022 #include <pandabase.h>
00023 #include <physicsObject.h>
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDAPHYSICS BaseParticle : public PhysicsObject {
00031 private:
00032
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 ©);
00042 virtual ~BaseParticle(void);
00043
00044 public:
00045
00046
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
00059 virtual void init(void) = 0;
00060 virtual void die(void) = 0;
00061 virtual void update(void) = 0;
00062
00063
00064 virtual float get_theta(void) const;
00065
00066
00067 virtual PhysicsObject *make_copy(void) const = 0;
00068 };
00069
00070 #include "baseParticle.I"
00071
00072 #endif // BASEPARTICLE_H