Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/particles/box_emitter.h @ 6825

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.
14class BoxEmitter : public ParticleEmitter
15{
16  friend class ParticleSystem;
17public:
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
30protected:
31  virtual void emitParticles(unsigned int count) const;
32
33private:
34  void init();
35
36private:
37  Vector      size;
38};
39
40#endif /* _BOX_EMITTER_H */
Note: See TracBrowser for help on using the repository browser.