Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.h @ 3932

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

orxonox/branches/particleEngine: the first particles are being drawn :)

File size: 1.4 KB
Line 
1/*!
2    \file particle_e,otter.h
3    \brief Definition of a ParticleEmitter
4*/
5
6#ifndef _PARTICLE_EMITTER_H
7#define _PARTICLE_EMITTER_H
8
9#include "p_node.h"
10
11// FORWARD DEFINITION
12struct Particle;
13class ParticleSystem;
14
15typedef enum EMITTER_TYPE {EMITTER_DOT,
16                           EMITTER_PLANE,
17                           EMITTER_SPHERE,
18                           EMITTER_CUBE};
19
20//! A default singleton class.
21class ParticleEmitter : public PNode {
22
23 public:
24  ParticleEmitter(const Vector& direction, float angle = 20.0, float emissionRate = 1.0, 
25                  float velocity = 1.0);
26  virtual ~ParticleEmitter(void);
27
28  /* controlling the emitter: interface */
29  void start();
30  void stop();
31  void tick(float dt, ParticleSystem* system);
32
33  /* controlling the behavour: these can be used as Animation interfaces */
34  void setEmissionRate(float emissionRate);
35  void setSpread(float angle, float randomAngle = 0.0);
36  void setVelocity(float velocity, float random = 0.0);
37
38 private:
39  Vector direction;     //!< emition direction
40  float angle;          //!< max angle from the direction of the emitter
41  float angleRandom;    //!< random emission angle (angle +- angleRandom is the emitted angle.
42  float emissionRate;   //!< amount of particles per seconds emitted by emiter
43  float velocity;       //!< the contant speed a particle gets if been emitted
44
45  float saveTime;       //!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big).
46};
47
48#endif /* _PARTICLE_EMITTER_H */
Note: See TracBrowser for help on using the repository browser.