Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // FIXME: Should we just pass the Particle draw members directly as
  9. // arguments to IParticleEffect::SimulateAndRender?
  10. // This file defines and implements the ParticleDraw class, which is used
  11. // by ParticleEffects to render particles. It simply stores render + simulation
  12. // state
  13. //
  14. #ifndef PARTICLEDRAW_H
  15. #define PARTICLEDRAW_H
  16. class IMaterial;
  17. class CMeshBuilder;
  18. class CParticleSubTexture;
  19. class ParticleDraw
  20. {
  21. friend class CParticleEffectBinding;
  22. public:
  23. ParticleDraw();
  24. void Init( CMeshBuilder *pMeshBuilder, IMaterial *pMaterial, float fTimeDelta );
  25. // Time delta..
  26. float GetTimeDelta() const;
  27. // Get the material being used (mostly useful for getting the tcoord padding).
  28. //IMaterial* GetPMaterial();
  29. // This can return NULL if the particle system is only being simulated.
  30. CMeshBuilder* GetMeshBuilder();
  31. CParticleSubTexture *m_pSubTexture;
  32. private:
  33. CMeshBuilder *m_pMeshBuilder;
  34. IMaterial *m_pMaterial;
  35. float m_fTimeDelta;
  36. };
  37. // ------------------------------------------------------------------------- //
  38. // Inlines
  39. // ------------------------------------------------------------------------- //
  40. inline ParticleDraw::ParticleDraw()
  41. {
  42. m_pMaterial = 0;
  43. }
  44. inline void ParticleDraw::Init( CMeshBuilder *pMeshBuilder, IMaterial *pMaterial, float fTimeDelta )
  45. {
  46. m_pMeshBuilder = pMeshBuilder;
  47. m_pMaterial = pMaterial;
  48. m_fTimeDelta = fTimeDelta;
  49. }
  50. inline float ParticleDraw::GetTimeDelta() const
  51. {
  52. return m_fTimeDelta;
  53. }
  54. inline CMeshBuilder* ParticleDraw::GetMeshBuilder()
  55. {
  56. return m_pMeshBuilder;
  57. }
  58. #endif