00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BASEPARTICLE_H
00016 #define BASEPARTICLE_H
00017
00018 #include "pandabase.h"
00019 #include "physicsObject.h"
00020
00021
00022
00023
00024
00025
00026 class EXPCL_PANDAPHYSICS BaseParticle : public PhysicsObject {
00027 public:
00028
00029 INLINE void set_age(PN_stdfloat age);
00030 INLINE void set_lifespan(PN_stdfloat lifespan);
00031 INLINE void set_alive(bool alive);
00032 INLINE void set_index(int index);
00033
00034
00035 INLINE PN_stdfloat get_age() const;
00036 INLINE PN_stdfloat get_lifespan() const;
00037 INLINE bool get_alive() const;
00038 INLINE int get_index() const;
00039
00040 INLINE PN_stdfloat get_parameterized_age() const;
00041 INLINE PN_stdfloat get_parameterized_vel() const;
00042
00043
00044 virtual void init() = 0;
00045 virtual void die() = 0;
00046 virtual void update() = 0;
00047
00048
00049 virtual PN_stdfloat get_theta() const;
00050
00051
00052 virtual PhysicsObject *make_copy() const = 0;
00053
00054 virtual void output(ostream &out) const;
00055 virtual void write(ostream &out, int indent=0) const;
00056
00057 protected:
00058 BaseParticle(PN_stdfloat lifespan = 1.0f, bool alive = false);
00059 BaseParticle(const BaseParticle ©);
00060 virtual ~BaseParticle();
00061
00062 private:
00063
00064 PN_stdfloat _age;
00065 PN_stdfloat _lifespan;
00066 bool _alive;
00067 int _index;
00068
00069 LPoint3 _last_position;
00070 };
00071
00072 #include "baseParticle.I"
00073
00074 #endif // BASEPARTICLE_H