00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023 #ifndef H_SPK_NORMALEMITTER
00024 #define H_SPK_NORMALEMITTER
00025
00026 #include "Core/SPK_Emitter.h"
00027
00028
00029 namespace SPK
00030 {
00041 class SPK_PREFIX NormalEmitter : public Emitter
00042 {
00043 SPK_IMPLEMENT_REGISTERABLE(NormalEmitter)
00044
00045 public :
00046
00048
00050
00056 NormalEmitter(Zone* normalZone = NULL,bool inverted = false);
00057
00065 static NormalEmitter* create(Zone* normalZone = NULL,bool inverted = false);
00066
00068
00070
00075 void setInverted(bool inverted);
00076
00084 void setNormalZone(Zone* zone);
00085
00087
00089
00094 bool isInverted() const;
00095
00100 Zone* getNormalZone() const;
00101
00103
00105
00106 virtual Registerable* findByName(const std::string& name);
00107
00108 protected :
00109
00110 virtual void registerChildren(bool registerAll);
00111 virtual void copyChildren(const Registerable& object,bool createBase);
00112 virtual void destroyChildren(bool keepChildren);
00113
00114 private :
00115
00116 bool inverted;
00117 Zone* normalZone;
00118
00119 virtual void generateVelocity(Particle& particle,float speed) const;
00120 };
00121
00122
00123 inline NormalEmitter* NormalEmitter::create(Zone* normalZone,bool inverted)
00124 {
00125 NormalEmitter* obj = new NormalEmitter(normalZone,inverted);
00126 registerObject(obj);
00127 return obj;
00128 }
00129
00130 inline void NormalEmitter::setInverted(bool inverted)
00131 {
00132 this->inverted = inverted;
00133 }
00134
00135 inline bool NormalEmitter::isInverted() const
00136 {
00137 return inverted;
00138 }
00139
00140 inline Zone* NormalEmitter::getNormalZone() const
00141 {
00142 return normalZone;
00143 }
00144 }
00145
00146 #endif