source:
orxonox.OLD/trunk/src/world_entities/particles/plane_emitter.h
@
10569
Last change on this file since 10569 was 9869, checked in by bensch, 18 years ago | |
---|---|
File size: 1.3 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 | { |
[9715] | 23 | ObjectListDeclaration(PlaneEmitter); |
[9686] | 24 | |
[6619] | 25 | friend class ParticleSystem; |
26 | public: | |
[6873] | 27 | PlaneEmitter(const Vector2D& size = PLANE_EMITTER_DEFAULT_SIZE, |
[9686] | 28 | float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE, |
29 | float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY, | |
30 | float angle = PARTICLE_EMITTER_DEFAULT_SPREAD); | |
[6873] | 31 | PlaneEmitter(const TiXmlElement* root); |
32 | virtual ~PlaneEmitter(); | |
[4597] | 33 | |
[6823] | 34 | virtual void loadParams(const TiXmlElement* root); |
[3926] | 35 | |
[6873] | 36 | void setSize(float x, float y); |
37 | void setSize(const Vector2D& size) { this->setSize(size.x, size.y); }; | |
[3927] | 38 | |
[6825] | 39 | protected: |
[6822] | 40 | virtual void emitParticles(unsigned int count) const; |
[6619] | 41 | |
[6822] | 42 | private: |
43 | void init(); | |
[3929] | 44 | |
[6619] | 45 | private: |
[6873] | 46 | Vector2D size; |
[3926] | 47 | }; |
48 | ||
[6873] | 49 | #endif /* _PLANE_EMITTER_H */ |
Note: See TracBrowser
for help on using the repository browser.