Panda3D
 All Classes Functions Variables Enumerations
ringEmitter.h
00001 // Filename: ringEmitter.h
00002 // Created by:  charles (22Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef RINGEMITTER_H
00016 #define RINGEMITTER_H
00017 
00018 #include "baseParticleEmitter.h"
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //       Class : RingEmitter
00022 // Description : Describes a planar ring region in which
00023 //               particles are generated.
00024 ////////////////////////////////////////////////////////////////////
00025 class EXPCL_PANDAPHYSICS RingEmitter : public BaseParticleEmitter {
00026 PUBLISHED:
00027   RingEmitter();
00028   RingEmitter(const RingEmitter &copy);
00029   virtual ~RingEmitter();
00030 
00031   virtual BaseParticleEmitter *make_copy();
00032 
00033   INLINE void set_radius(PN_stdfloat r);
00034   INLINE void set_angle(PN_stdfloat angle);
00035   INLINE void set_radius_spread(PN_stdfloat spread);
00036   INLINE void set_uniform_emission(int uniform_emission);
00037 
00038   INLINE PN_stdfloat get_radius() const;
00039   INLINE PN_stdfloat get_angle() const;
00040   INLINE PN_stdfloat get_radius_spread() const;
00041   INLINE int get_uniform_emission() const;
00042 
00043   virtual void output(ostream &out) const;
00044   virtual void write(ostream &out, int indent=0) const;
00045 
00046 protected:
00047   PN_stdfloat _radius;
00048   PN_stdfloat _radius_spread;
00049 
00050   // CUSTOM EMISSION PARAMETERS
00051   PN_stdfloat _aoe;  // angle of elevation
00052 
00053   // viariables used for uniform particle emission
00054   int _uniform_emission;
00055   PN_stdfloat _theta;
00056 
00057   ///////////////////////////////
00058   // scratch variables that carry over from position calc to velocity calc
00059   PN_stdfloat _sin_theta;
00060   PN_stdfloat _cos_theta;
00061   ///////////////////////////////
00062 
00063 private:
00064   virtual void assign_initial_position(LPoint3& pos);
00065   virtual void assign_initial_velocity(LVector3& vel);
00066 };
00067 
00068 #include "ringEmitter.I"
00069 
00070 #endif // RINGEMITTER_H
 All Classes Functions Variables Enumerations