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

panda/src/particlesystem/baseParticleEmitter.h

Go to the documentation of this file.
00001 // Filename: baseParticleEmitter.h
00002 // Created by:  charles (14Jun00)
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 BASEPARTICLEEMITTER_H
00020 #define BASEPARTICLEEMITTER_H
00021 
00022 #include <pandabase.h>
00023 #include <referenceCount.h>
00024 #include <luse.h>
00025 
00026 #include "particleCommonFuncs.h"
00027 
00028 #include <mathNumbers.h>
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : BaseParticleEmitter
00032 // Description : Describes a physical region in space in which
00033 //               particles are randomly generated.
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDAPHYSICS BaseParticleEmitter : public ReferenceCount {
00036 PUBLISHED:
00037   enum emissionType {
00038     ET_EXPLICIT, // all particles are emitted in parallel along the same vector
00039     ET_RADIATE,  // all particles radiate away from a single point
00040     ET_CUSTOM    // particle launch vectors are dependent on particular derived emitter
00041   };
00042 
00043   virtual ~BaseParticleEmitter(void);
00044   virtual BaseParticleEmitter *make_copy(void) = 0;
00045 
00046   void generate(LPoint3f& pos, LVector3f& vel);
00047 
00048   INLINE void set_emission_type(emissionType et);
00049   INLINE void set_amplitude(float a);
00050   INLINE void set_amplitude_spread(float as);
00051   INLINE void set_offset_force(const LVector3f& of);  // this is a constant force applied to all particles
00052   INLINE void set_explicit_launch_vector(const LVector3f& elv);
00053   INLINE void set_radiate_origin(const LPoint3f& ro);
00054 
00055   INLINE emissionType get_emission_type(void) const;
00056   INLINE float get_amplitude(void) const;
00057   INLINE float get_amplitude_spread(void) const;
00058   INLINE LVector3f get_offset_force(void) const;
00059   INLINE LVector3f get_explicit_launch_vector(void) const;
00060   INLINE LPoint3f get_radiate_origin(void) const;
00061 
00062 protected:
00063   BaseParticleEmitter(void);
00064   BaseParticleEmitter(const BaseParticleEmitter &copy);
00065 
00066   emissionType _emission_type;
00067   LVector3f _explicit_launch_vector;
00068   LPoint3f  _radiate_origin;
00069 
00070   float _amplitude;
00071   float _amplitude_spread;
00072 
00073 private:
00074   // these should be called in sequence (pos, then vel)
00075   virtual void assign_initial_position(LPoint3f& pos) = 0;
00076   virtual void assign_initial_velocity(LVector3f& vel) = 0;
00077 
00078   LVector3f _offset_force;
00079 };
00080 
00081 #include "baseParticleEmitter.I"
00082 
00083 #endif // BASEPARTICLEEMITTER_H

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