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

panda/src/particlesystem/baseParticleFactory.h

Go to the documentation of this file.
00001 // Filename: baseParticleFactory.h
00002 // Created by:  charles (05Jul00)
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 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 //       Class : BaseParticleFactory
00032 // Description : Pure Virtual base class for creating particles
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 &copy);
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

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