00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BASEPARTICLEFACTORY_H
00020 #define BASEPARTICLEFACTORY_H
00021
00022 #include <pandabase.h>
00023 #include <referenceCount.h>
00024
00025 #include "baseParticle.h"
00026 #include "particleCommonFuncs.h"
00027
00028 #include <stdlib.h>
00029
00030
00031
00032
00033
00034 class EXPCL_PANDAPHYSICS BaseParticleFactory : public ReferenceCount {
00035 private:
00036 float _lifespan_base;
00037 float _lifespan_spread;
00038
00039 float _mass_base;
00040 float _mass_spread;
00041
00042 float _terminal_velocity_base;
00043 float _terminal_velocity_spread;
00044
00045 virtual void populate_child_particle(BaseParticle *bp) const = 0;
00046
00047 protected:
00048 BaseParticleFactory(void);
00049 BaseParticleFactory(const BaseParticleFactory ©);
00050
00051 PUBLISHED:
00052 virtual ~BaseParticleFactory(void);
00053
00054 INLINE void set_lifespan_base(float lb);
00055 INLINE void set_lifespan_spread(float ls);
00056 INLINE void set_mass_base(float mb);
00057 INLINE void set_mass_spread(float ms);
00058 INLINE void set_terminal_velocity_base(float tvb);
00059 INLINE void set_terminal_velocity_spread(float tvs);
00060
00061 INLINE float get_lifespan_base(void) const;
00062 INLINE float get_lifespan_spread(void) const;
00063 INLINE float get_mass_base(void) const;
00064 INLINE float get_mass_spread(void) const;
00065 INLINE float get_terminal_velocity_base(void) const;
00066 INLINE float get_terminal_velocity_spread(void) const;
00067
00068 virtual BaseParticle *alloc_particle(void) const = 0;
00069
00070 void populate_particle(BaseParticle* bp);
00071 };
00072
00073 #include "baseParticleFactory.I"
00074
00075 #endif // BASEPARTICLEFACTORY_H