Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/particles/particle_emitter.h @ 4162

Last change on this file since 4162 was 3966, checked in by bensch, 20 years ago

orxonox/trunk: merged branches/particleEngine into the trunk, because of the new vector class
merged with command:
svn merge -r 3922:HEAD particleEngine/ ../trunk/

not merged src/story_entities/world.cc. will do this at a later time (do not forget)

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