Last change
on this file since 6825 was
6825,
checked in by bensch, 18 years ago
|
trunk: new interface to ParticleEmitters
|
File size:
974 bytes
|
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 an Emitter. |
---|
14 | class BoxEmitter : public ParticleEmitter |
---|
15 | { |
---|
16 | friend class ParticleSystem; |
---|
17 | public: |
---|
18 | BoxEmitter(const Vector& size = BOX_EMITTER_DEFAULT_SIZE, |
---|
19 | float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE, |
---|
20 | float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY, |
---|
21 | float angle = PARTICLE_EMITTER_DEFAULT_SPREAD); |
---|
22 | BoxEmitter(const TiXmlElement* root); |
---|
23 | virtual ~BoxEmitter(); |
---|
24 | |
---|
25 | virtual void loadParams(const TiXmlElement* root); |
---|
26 | |
---|
27 | void setSize(float x, float y, float z); |
---|
28 | void setSize(const Vector& size) { this->setSize(size.x, size.y, size.z); }; |
---|
29 | |
---|
30 | protected: |
---|
31 | virtual void emitParticles(unsigned int count) const; |
---|
32 | |
---|
33 | private: |
---|
34 | void init(); |
---|
35 | |
---|
36 | private: |
---|
37 | Vector size; |
---|
38 | }; |
---|
39 | |
---|
40 | #endif /* _BOX_EMITTER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.