Last change
on this file since 7352 was
6873,
checked in by bensch, 19 years ago
|
orxonox/trunk: Emitter is emitting correctly
|
File size:
1.2 KB
|
Rev | Line | |
---|
[4597] | 1 | /*! |
---|
[6873] | 2 | * @file plane_emitter.h |
---|
| 3 | * Definition of a PlaneEmitter |
---|
[6822] | 4 | */ |
---|
[3926] | 5 | |
---|
[6873] | 6 | #ifndef _PLANE_EMITTER_H |
---|
| 7 | #define _PLANE_EMITTER_H |
---|
[3926] | 8 | |
---|
[6822] | 9 | #include "particle_emitter.h" |
---|
[3926] | 10 | |
---|
[6873] | 11 | #include "vector2D.h" |
---|
[6825] | 12 | |
---|
[6873] | 13 | #define PLANE_EMITTER_DEFAULT_SIZE Vector2D(1.0f, 1.0f) |
---|
| 14 | |
---|
| 15 | //! A class to handle a Plane Emitter. |
---|
[6826] | 16 | /** |
---|
[6873] | 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 |
---|
[6826] | 20 | */ |
---|
[6873] | 21 | class PlaneEmitter : public ParticleEmitter |
---|
[6619] | 22 | { |
---|
| 23 | friend class ParticleSystem; |
---|
| 24 | public: |
---|
[6873] | 25 | PlaneEmitter(const Vector2D& size = PLANE_EMITTER_DEFAULT_SIZE, |
---|
[6825] | 26 | float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE, |
---|
| 27 | float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY, |
---|
| 28 | float angle = PARTICLE_EMITTER_DEFAULT_SPREAD); |
---|
[6873] | 29 | PlaneEmitter(const TiXmlElement* root); |
---|
| 30 | virtual ~PlaneEmitter(); |
---|
[4597] | 31 | |
---|
[6823] | 32 | virtual void loadParams(const TiXmlElement* root); |
---|
[3926] | 33 | |
---|
[6873] | 34 | void setSize(float x, float y); |
---|
| 35 | void setSize(const Vector2D& size) { this->setSize(size.x, size.y); }; |
---|
[3927] | 36 | |
---|
[6825] | 37 | protected: |
---|
[6822] | 38 | virtual void emitParticles(unsigned int count) const; |
---|
[6619] | 39 | |
---|
[6822] | 40 | private: |
---|
| 41 | void init(); |
---|
[3929] | 42 | |
---|
[6619] | 43 | private: |
---|
[6873] | 44 | Vector2D size; |
---|
[3926] | 45 | }; |
---|
| 46 | |
---|
[6873] | 47 | #endif /* _PLANE_EMITTER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.