Last change
on this file since 8334 was
6826,
checked in by bensch, 19 years ago
|
orxonox/trunk: ok, the Cube Emitter works
|
File size:
1.2 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file box_emitter.h |
---|
3 | * Definition of a BoxEmitter |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _BOX_EMITTER_H |
---|
7 | #define _BOX_EMITTER_H |
---|
8 | |
---|
9 | #include "particle_emitter.h" |
---|
10 | |
---|
11 | #define BOX_EMITTER_DEFAULT_SIZE Vector(1.0f, 1.0f, 1.0f) |
---|
12 | |
---|
13 | //! A class to handle a Box Emitter. |
---|
14 | /** |
---|
15 | * A Box Emitter is a special kind of emitter, that has the (underlying) PNode |
---|
16 | * at its center, and from there on is a Box in the Direction of the PNode |
---|
17 | * out around size in the corresponding directions |
---|
18 | */ |
---|
19 | class BoxEmitter : public ParticleEmitter |
---|
20 | { |
---|
21 | friend class ParticleSystem; |
---|
22 | public: |
---|
23 | BoxEmitter(const Vector& size = BOX_EMITTER_DEFAULT_SIZE, |
---|
24 | float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE, |
---|
25 | float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY, |
---|
26 | float angle = PARTICLE_EMITTER_DEFAULT_SPREAD); |
---|
27 | BoxEmitter(const TiXmlElement* root); |
---|
28 | virtual ~BoxEmitter(); |
---|
29 | |
---|
30 | virtual void loadParams(const TiXmlElement* root); |
---|
31 | |
---|
32 | void setSize(float x, float y, float z); |
---|
33 | void setSize(const Vector& size) { this->setSize(size.x, size.y, size.z); }; |
---|
34 | |
---|
35 | protected: |
---|
36 | virtual void emitParticles(unsigned int count) const; |
---|
37 | |
---|
38 | private: |
---|
39 | void init(); |
---|
40 | |
---|
41 | private: |
---|
42 | Vector size; |
---|
43 | }; |
---|
44 | |
---|
45 | #endif /* _BOX_EMITTER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.