/*! * @file plane_emitter.h * Definition of a PlaneEmitter */ #ifndef _PLANE_EMITTER_H #define _PLANE_EMITTER_H #include "particle_emitter.h" #include "vector2D.h" #define PLANE_EMITTER_DEFAULT_SIZE Vector2D(1.0f, 1.0f) //! A class to handle a Plane Emitter. /** * A Plane Emitter is a special kind of emitter, that has the (underlying) PNode * at its center, and from there on is a Plane in the Direction of the PNode * out around size in the corresponding directions in x and z */ class PlaneEmitter : public ParticleEmitter { ObjectListDeclaration(PlaneEmitter); friend class ParticleSystem; public: PlaneEmitter(const Vector2D& size = PLANE_EMITTER_DEFAULT_SIZE, float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE, float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY, float angle = PARTICLE_EMITTER_DEFAULT_SPREAD); PlaneEmitter(const TiXmlElement* root); virtual ~PlaneEmitter(); virtual void loadParams(const TiXmlElement* root); void setSize(float x, float y); void setSize(const Vector2D& size) { this->setSize(size.x, size.y); }; protected: virtual void emitParticles(unsigned int count) const; private: void init(); private: Vector2D size; }; #endif /* _PLANE_EMITTER_H */