ParticleTechnique.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef PARTICLE_TECHNIQUE_H
  2. #define PARTICLE_TECHNIQUE_H
  3. #include "ParticleEmitter.h"
  4. #include "ParticleRenderer.h"
  5. #include "ParticlePool.h"
  6. #include "ParticlePoolMap.h"
  7. class ParticleSystem;
  8. class ParticleTechnique
  9. {
  10. public:
  11. ParticleTechnique();
  12. virtual ~ParticleTechnique();
  13. void CopyAttributesTo(ParticleTechnique* technique);
  14. void SetParentSystem(ParticleSystem* parentSystem) {m_ParentSystem = parentSystem;};
  15. ParticleSystem* GetParentSystem() const {return m_ParentSystem;};
  16. // this fucntion called from ParticleSystem which implements _updateRenderQueue from movable objects
  17. void UpdateRenderQueue(Ogre::RenderQueue* queue);
  18. void Initialize();
  19. void Update(Ogre::Real time_elapsed);
  20. ParticleRenderer* CreateRenderer(const Ogre::String& renderer_type);
  21. void SetRenderer(ParticleRenderer* renderer);
  22. void DestroyRenderer();
  23. ParticleEmitter* CreateEmitter(const Ogre::String& emitter_type);
  24. void AddEmitter(ParticleEmitter* emitter);
  25. void DestroyAllEmitters();
  26. int GetNumEmittableEmitters() const;
  27. void EmissionChange();
  28. int GetVisualParticlesQuota() const {return m_VisualParticleQuota;};
  29. void ExecuteEmitParticles(ParticleEmitter* emitter, int requested, Ogre::Real time_elapsed);
  30. void ResetVisualParticles();
  31. private:
  32. ParticleSystem* m_ParentSystem;
  33. ParticleRenderer* m_Renderer;
  34. int m_VisualParticleQuota;
  35. bool m_VisualParticlePoolIncreased;
  36. ParticlePool<VisualParticle> m_VisualParticlesPool;
  37. std::vector<VisualParticle*> m_VisualParticles;
  38. int m_EmittedEmitterQuota;
  39. bool m_ParticleEmitterPoolIncreased;
  40. ParticlePoolMap<ParticleEmitter> m_ParticleEmitterPool;
  41. std::vector<ParticleEmitter*> m_Emitters;
  42. };
  43. #endif // PARTICLE_TECHNIQUE_H