Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/particles/plane_emitter.h @ 8295

Last change on this file since 8295 was 6873, checked in by bensch, 19 years ago

orxonox/trunk: Emitter is emitting correctly

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