Line | |
---|
1 | /*! |
---|
2 | * @file plane_emitter.h |
---|
3 | * Definition of a PlaneEmitter |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _PLANE_EMITTER_H |
---|
7 | #define _PLANE_EMITTER_H |
---|
8 | |
---|
9 | #include "particle_emitter.h" |
---|
10 | |
---|
11 | #include "vector2D.h" |
---|
12 | |
---|
13 | #define PLANE_EMITTER_DEFAULT_SIZE Vector2D(1.0f, 1.0f) |
---|
14 | |
---|
15 | //! A class to handle a Plane Emitter. |
---|
16 | /** |
---|
17 | * A Plane Emitter is a special kind of emitter, that has the (underlying) PNode |
---|
18 | * at its center, and from there on is a Plane in the Direction of the PNode |
---|
19 | * out around size in the corresponding directions in x and z |
---|
20 | */ |
---|
21 | class PlaneEmitter : public ParticleEmitter |
---|
22 | { |
---|
23 | ObjectListDeclaration(PlaneEmitter); |
---|
24 | |
---|
25 | friend class ParticleSystem; |
---|
26 | public: |
---|
27 | PlaneEmitter(const Vector2D& size = PLANE_EMITTER_DEFAULT_SIZE, |
---|
28 | float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE, |
---|
29 | float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY, |
---|
30 | float angle = PARTICLE_EMITTER_DEFAULT_SPREAD); |
---|
31 | PlaneEmitter(const TiXmlElement* root); |
---|
32 | virtual ~PlaneEmitter(); |
---|
33 | |
---|
34 | virtual void loadParams(const TiXmlElement* root); |
---|
35 | |
---|
36 | void setSize(float x, float y); |
---|
37 | void setSize(const Vector2D& size) { this->setSize(size.x, size.y); }; |
---|
38 | |
---|
39 | protected: |
---|
40 | virtual void emitParticles(unsigned int count) const; |
---|
41 | |
---|
42 | private: |
---|
43 | void init(); |
---|
44 | |
---|
45 | private: |
---|
46 | Vector2D size; |
---|
47 | }; |
---|
48 | |
---|
49 | #endif /* _PLANE_EMITTER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.