particlegeo.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _particlegeo_H_
  2. #define _particlegeo_H_
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // ParticleGeo
  6. //
  7. //////////////////////////////////////////////////////////////////////////////
  8. class ParticleData;
  9. class ParticleBehavior
  10. {
  11. public:
  12. virtual void Render (Context* pContext, ParticleData* pParticleData, float fElapsedTime) = 0;
  13. };
  14. class ParticleData
  15. {
  16. friend class ParticleGeoImpl;
  17. public:
  18. Vector m_vecPosition;
  19. Vector m_vecVelocity;
  20. Vector m_vecAcceleration;
  21. float m_fSize;
  22. float m_fDuration;
  23. float m_fAngle;
  24. public:
  25. /* void */ ParticleData (void);
  26. private:
  27. float m_fStartTime;
  28. ParticleBehavior* m_pParticleBehavior;
  29. private:
  30. void InitParticle (float fTime, ParticleBehavior* pParticleBehavior);
  31. };
  32. class ParticleGeo : public Geo
  33. {
  34. public:
  35. /* void */ ParticleGeo (Number* pTime) : Geo (pTime) {}
  36. virtual ParticleData* AddAfterburner (void) = 0;
  37. virtual ParticleData* AddDamage (void) = 0;
  38. virtual ParticleData* AddSmoke (void) = 0;
  39. virtual ParticleData* AddFire (void) = 0;
  40. virtual ParticleData* AddSpark (void) = 0;
  41. };
  42. TRef<ParticleGeo> CreateParticleGeo (Modeler* pModeler, Number* pTime);
  43. //////////////////////////////////////////////////////////////////////////////
  44. #endif