vee_emitter.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /* COPYRIGHT
00004  *
00005  * This file is part of the Visual Effects Engine - VEE
00006  *
00007  * Read the "VEE-LICENSE" file for the license.
00008  *
00009  * Authors & Copyright:   
00010  *
00011  * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 
00012  * Janne Kontkanen 2001-2004
00013  *
00014  * Additional copyrights: Tekes 2003-2004
00015  *
00016  * firstname.lastname@hut.fi
00017  *
00018  */
00019 
00020 #ifndef VEE_EMITTER_H
00021 #define VEE_EMITTER_H
00022 
00023 #include <vee_clonable_pointer.h>
00024 #include <vee_particle2.h>
00025 
00026 #include <vector>
00027 
00028 class VEE_Emitter : public VEE_Particle2
00029 {
00030 public:
00031   VEE_Emitter(VEE_Object *type = 0, float creationRate = 100.0f);
00032   virtual ~VEE_Emitter();
00033 
00034   virtual bool setValue(const char *, VEE_Value *);
00035   virtual VEE_Variable getVariable(const char *) const;
00036 
00037   virtual VEE_Object *clone() const;
00038 
00039   virtual void update(float dt);
00040   virtual void collision(const VEE_Vector3 &);
00041 
00042   VEE_OperatorList & operators() { return m_plist; }
00043   void appendOperator(VEE_Operator *o) { m_plist.appendOperator(o); }
00044   void appendOperator2(VEE_Operator *o, const char * name) 
00045   { m_plist.appendOperator(o, name); }
00046 
00047   bool removeOperator(const char *name, bool alsoDelete = true);
00048 
00049   void setRate(float hz) { m_interval = 1.0 / hz; }
00050 
00051   // VEE_Emitter & operator = (const VEE_Emitter &);
00052 
00053   void setInheritVelocity(bool inherit) { m_inheritVelocity = inherit; }
00054 
00055   void setType(VEE_Object *o) { m_type = o; }
00056 
00057   VEE_Object * create(float, float);
00058 
00059   void setAccumulate(bool accumulate) { m_accumulate = accumulate; }
00060 
00061   std::vector<VEE_Object *> & accumulated() { return m_justCreated; }
00062 
00063 protected:
00064 
00065   float m_interval, m_untilNext;
00066   float m_rateMul;
00067   float m_afterCollisionInterval;
00068   VEE_Vector3 m_lastPos;
00069   
00070   bool m_inheritVelocity;
00071   bool m_accumulate;
00072   bool m_collisionNewRate;
00073 
00074   int m_maxCount;
00075   int m_count;
00076   
00077 
00078   VEE_OperatorList m_plist;
00079   // VEE_Object      *m_type;
00080   VEE_ClonablePointer<VEE_Object> m_type;
00081   
00082   std::vector<VEE_Object *> m_justCreated;
00083 };
00084 
00085 #endif

Generated on Mon Mar 12 21:09:00 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6