ParticleSystem.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <OgreMovableObject.h>
  17. #include "ParticleTechnique.h"
  18. /**
  19. * A particle system.
  20. *
  21. * @todo What is this?
  22. */
  23. class ParticleSystem : public Ogre::MovableObject{
  24. public:
  25. /**
  26. * Constructor.
  27. */
  28. ParticleSystem(const Ogre::String& name);
  29. /**
  30. * Destructor.
  31. */
  32. virtual ~ParticleSystem();
  33. /**
  34. * Copies the system attributes to another ParticleSystem.
  35. *
  36. * @param ps[out] The ParticleSystem to copy the attributes to.
  37. */
  38. void CopyAttributesTo(ParticleSystem* ps);
  39. // realization of Ogre::MovableObject
  40. /**
  41. * Retrieves the movable type.
  42. *
  43. * @return The movable type.
  44. * @todo Understand and document.
  45. */
  46. const Ogre::String& getMovableType() const;
  47. /**
  48. * Retrieves the object bounding box.
  49. *
  50. * @return The bounding box.
  51. */
  52. const Ogre::AxisAlignedBox& getBoundingBox() const;
  53. /**
  54. * Retrieves the bounding radius.
  55. *
  56. * @return The bounding radius.
  57. */
  58. Ogre::Real getBoundingRadius() const;
  59. /**
  60. * Adds the system to the scene render queue.
  61. *
  62. * @param queue[in|out] The queue to update.
  63. */
  64. void _updateRenderQueue(Ogre::RenderQueue* queue);
  65. /**
  66. * Visits renderables.
  67. *
  68. * @param visitor[in] The visitor.
  69. * @param debug_renderables[in] True to debug the renderables, default
  70. * is false
  71. * @todo Understand and document.
  72. */
  73. void visitRenderables(
  74. Ogre::Renderable::Visitor* visitor, bool debug_renderables = false
  75. ){};
  76. /**
  77. * Updates the system.
  78. *
  79. * Updates the system status based on the elapsed time.
  80. *
  81. * @param time_elapsed[in] The elapsed time.
  82. */
  83. void Update(Ogre::Real time_elapsed);
  84. /**
  85. * Technique creator.
  86. *
  87. * Creates a new technique and adds it to the system.
  88. *
  89. * @return Pointer to the newly created technique.
  90. */
  91. ParticleTechnique* CreateTechnique();
  92. /**
  93. * Adds a technique to the system.
  94. *
  95. * @param techique[in] Technique to add to the system
  96. */
  97. void AddTechnique(ParticleTechnique* technique);
  98. /**
  99. * Removes al techniques from the system.
  100. */
  101. void DestroyAllTechniques();
  102. private:
  103. /**
  104. * List of the system techniques.
  105. */
  106. std::vector<ParticleTechnique*> techniques_;
  107. };