|
Last change
on this file since 3943 was
3943,
checked in by bensch, 21 years ago
|
|
orxonox/branches/particleEngine: now the ParticleSystem/Emitter should get deleted nicely
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | \file particle_engine.h |
|---|
| 3 | \brief Definition of the ParticleEngine |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef _PARTICLE_ENGINE_H |
|---|
| 7 | #define _PARTICLE_ENGINE_H |
|---|
| 8 | |
|---|
| 9 | #include "base_object.h" |
|---|
| 10 | |
|---|
| 11 | // FORWARD DEFINITION |
|---|
| 12 | template<class T> class tList; |
|---|
| 13 | class ParticleSystem; |
|---|
| 14 | class ParticleEmitter; |
|---|
| 15 | |
|---|
| 16 | struct ParticleConnection |
|---|
| 17 | { |
|---|
| 18 | ParticleEmitter* emitter; //!< The emitter to emit system from. |
|---|
| 19 | ParticleSystem* system; //!< The Particles emitted from emitter. |
|---|
| 20 | }; |
|---|
| 21 | |
|---|
| 22 | //! A default singleton class. |
|---|
| 23 | class ParticleEngine : public BaseObject { |
|---|
| 24 | |
|---|
| 25 | public: |
|---|
| 26 | static ParticleEngine* getInstance(void); |
|---|
| 27 | virtual ~ParticleEngine(void); |
|---|
| 28 | |
|---|
| 29 | void tick(float dt); |
|---|
| 30 | void draw(void); |
|---|
| 31 | |
|---|
| 32 | void addSystem(ParticleSystem* system); |
|---|
| 33 | void addEmitter(ParticleEmitter* emitter); |
|---|
| 34 | void addConnection(ParticleEmitter* emitter, ParticleSystem* system); |
|---|
| 35 | |
|---|
| 36 | bool removeSystem(ParticleSystem* system); |
|---|
| 37 | bool removeEmitter(ParticleEmitter* emitter); |
|---|
| 38 | bool breakConnection(ParticleEmitter* emitter, ParticleSystem* system); |
|---|
| 39 | bool breakConnection(ParticleConnection* connection); |
|---|
| 40 | |
|---|
| 41 | private: |
|---|
| 42 | ParticleEngine(void); |
|---|
| 43 | static ParticleEngine* singletonRef; |
|---|
| 44 | |
|---|
| 45 | tList<ParticleSystem>* systemList; |
|---|
| 46 | tList<ParticleEmitter>* emitterList; |
|---|
| 47 | |
|---|
| 48 | tList<ParticleConnection>* connectionList; |
|---|
| 49 | }; |
|---|
| 50 | |
|---|
| 51 | #endif /* _PARTICLE_ENGINE_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.