|
28 | 28 | // abstract base class. |
29 | 29 | //////////////////////////////////////////////////////////////////// |
30 | 30 | class EXPCL_PANDAPHYSICS BaseParticle : public PhysicsObject { |
31 | | -private: |
32 | | - // NOTE: age and lifespan are in seconds. |
33 | | - float _age; |
34 | | - float _lifespan; |
35 | | - bool _alive; |
36 | | - |
37 | | - LPoint3f _last_position; |
38 | | - |
39 | | -protected: |
40 | | - BaseParticle(int lifespan = 1, bool alive = false); |
41 | | - BaseParticle(const BaseParticle ©); |
42 | | - virtual ~BaseParticle(void); |
43 | | - |
44 | 31 | public: |
45 | | - |
46 | 32 | // local methods |
47 | 33 | INLINE void set_age(float age); |
48 | 34 | INLINE void set_lifespan(float lifespan); |
49 | 35 | INLINE void set_alive(bool alive); |
50 | 36 |
|
51 | | - INLINE float get_age(void) const; |
52 | | - INLINE float get_lifespan(void) const; |
53 | | - INLINE bool get_alive(void) const; |
| 37 | + INLINE float get_age() const; |
| 38 | + INLINE float get_lifespan() const; |
| 39 | + INLINE bool get_alive() const; |
54 | 40 |
|
55 | | - INLINE float get_parameterized_age(void) const; |
56 | | - INLINE float get_parameterized_vel(void) const; |
| 41 | + INLINE float get_parameterized_age() const; |
| 42 | + INLINE float get_parameterized_vel() const; |
57 | 43 |
|
58 | 44 | // child methods |
59 | | - virtual void init(void) = 0; |
60 | | - virtual void die(void) = 0; |
61 | | - virtual void update(void) = 0; |
| 45 | + virtual void init() = 0; |
| 46 | + virtual void die() = 0; |
| 47 | + virtual void update() = 0; |
62 | 48 |
|
63 | 49 | // for spriteParticleRenderer |
64 | | - virtual float get_theta(void) const; |
| 50 | + virtual float get_theta() const; |
65 | 51 |
|
66 | 52 | // from PhysicsObject |
67 | | - virtual PhysicsObject *make_copy(void) const = 0; |
| 53 | + virtual PhysicsObject *make_copy() const = 0; |
| 54 | + |
| 55 | + virtual void output(ostream &out) const; |
| 56 | + virtual void write(ostream &out, unsigned int indent=0) const; |
| 57 | + |
| 58 | +protected: |
| 59 | + BaseParticle(int lifespan = 1, bool alive = false); |
| 60 | + BaseParticle(const BaseParticle ©); |
| 61 | + virtual ~BaseParticle(); |
| 62 | + |
| 63 | +private: |
| 64 | + // NOTE: age and lifespan are in seconds. |
| 65 | + float _age; |
| 66 | + float _lifespan; |
| 67 | + bool _alive; |
| 68 | + |
| 69 | + LPoint3f _last_position; |
68 | 70 | }; |
69 | 71 |
|
70 | 72 | #include "baseParticle.I" |
|
0 commit comments