Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/branches/particleEngine: spread works, and many other functions implemented

File size: 1.5 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 = .5, 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 randomVelocity = 0.0);
37
38 private:
39  Vector direction;     //!< emition direction
40  float angle;          //!< max angle from the direction of the emitter
41  float randomAngle;    //!< random emission angle (angle +- angleRandom is the emitted angle.
42  float emissionRate;   //!< amount of particles per seconds emitted by emitter.
43  float velocity;       //!< the initial speed of a Particles.
44  float randomVelocity; //!< the random variation from the initial Speed.
45
46  float saveTime;       //!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big).
47};
48
49#endif /* _PARTICLE_EMITTER_H */
Note: See TracBrowser for help on using the repository browser.