Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/playability/src/world_entities/particles/emitter_node.h @ 10086

Last change on this file since 10086 was 10078, checked in by marcscha, 18 years ago

Update in swarm launcher, swarm missile, mbolt

File size: 1.4 KB
Line 
1/*!
2 * @file particle_emitter.h
3  *  Definition of a EmitterNode
4  *  An emitter node is a node that takes an emitter and a particle system and keeps them alive for a given amount of time.
5*/
6
7#ifndef _EMITTER_NODE_H
8#define _EMITTER_NODE_H
9
10#include "p_node.h"
11#include "dot_emitter.h"
12
13// FORWARD DECLARATION
14class DotEmitter;
15class ParticleEmitter;
16class TiXmlElement;
17
18//! A class to handle an Emitter.
19class EmitterNode : public PNode
20{
21  ObjectListDeclaration(EmitterNode);
22public:
23  EmitterNode(float lifetime);
24  virtual ~EmitterNode();
25
26  virtual void loadParams(const TiXmlElement* root = NULL);
27 
28  virtual void tick( float time);
29
30  bool start();
31  inline void setVelocity(Vector velocity) { this->velocity = velocity;};
32
33  inline void setupParticle(DotEmitter* emitter, ParticleSystem* system) { this->emitter = emitter; this->system = system;} ;
34  void setLifetime( float lifeTime) { this->lifeSpan  = lifeTime;};
35
36private:
37  float           lifeSpan;           //!< Life time of this emitter node
38  float           lifeCycle;         
39  bool            started;            //!< was this emitter node started?
40
41  Vector          velocity;           //!< Velocity per second of the node
42
43  DotEmitter*  emitter;          //!< emitter which is held and kept alive
44  ParticleSystem*   system;           //!< system to be used on the particle emitter
45};
46
47#endif /* _EMITTER_NODE_H */
Note: See TracBrowser for help on using the repository browser.