ParticleEntityRenderer.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 <OgreSceneNode.h>
  17. #include "ParticleEntityAdditionalData.h"
  18. #include "ParticleEntityRendererDictionary.h"
  19. #include "../ParticleRenderer.h"
  20. /**
  21. * A particle entity renderer.
  22. */
  23. class ParticleEntityRenderer : public ParticleRenderer{
  24. public:
  25. /**
  26. * Constructor.
  27. */
  28. ParticleEntityRenderer();
  29. /**
  30. * Destructor.
  31. */
  32. virtual ~ParticleEntityRenderer();
  33. /**
  34. * Copies the atributtes to other renderer.
  35. *
  36. * @param renderer[out] Renderer to copy the attributes to.
  37. */
  38. virtual void CopyAttributesTo(ParticleRenderer* renderer);
  39. /**
  40. * Retrieves the emitter's mesh name.
  41. *
  42. * @return The emitter mesh name.
  43. */
  44. const Ogre::String& GetMeshName() const;
  45. /**
  46. * Sets the emitter's mesh name.
  47. *
  48. * @param mesh_name[in] The name for the emitter's mesh.
  49. */
  50. void SetMeshName(const Ogre::String& mesh_name);
  51. /**
  52. * Clears all data in the entity.
  53. */
  54. void Clear();
  55. /**
  56. * Toggles the particle entity visibility.
  57. *
  58. * @param visible[in] True to make the particle visible, false to make
  59. * it invisible.
  60. */
  61. virtual void SetVisible(bool visible);
  62. /**
  63. * Initializes the particle.
  64. */
  65. virtual void Initialize();
  66. /**
  67. * Adds the particle to the scene render queue.
  68. *
  69. * @param queue[] Unused
  70. * @param pool[in] The particle pool.
  71. */
  72. virtual void UpdateRenderQueue(
  73. Ogre::RenderQueue* queue, ParticlePool<VisualParticle>& pool
  74. );
  75. protected:
  76. /**
  77. * Additional data for the rendered.
  78. */
  79. std::vector<ParticleEntityAdditionalData*> all_additional_data_;
  80. /**
  81. * Additional data for the rendered that is not yet assigned.
  82. */
  83. std::vector<ParticleEntityAdditionalData*> unassigned_additional_data_;
  84. /**
  85. * List of entities.
  86. *
  87. * @todo What are these entities?
  88. */
  89. std::vector<Ogre::Entity*> entities_;
  90. /**
  91. * A dictionary of mesh names.
  92. */
  93. static ParticleEntityRendererDictionary::MeshName mesh_name_dictionary_;
  94. /**
  95. * The mesh name for the particles.
  96. */
  97. Ogre::String mesh_name_;
  98. };