| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #pragma once
- #include "WallpaperEngine/Core/Core.h"
- namespace WallpaperEngine::Core::Objects::Particles {
- using json = nlohmann::json;
- /**
- * Particle emitter, controls the area where the particles have to be created
- */
- class CEmitter {
- public:
- static CEmitter* fromJSON (json data);
- /**
- * @return The ID of the emitter
- */
- [[nodiscard]] uint32_t getId () const;
- /**
- * @return The name of the emitter, indicates what type of emission to do
- */
- [[nodiscard]] const std::string& getName () const;
- /**
- * @return The maximum distance a particle can travel before being dead
- */
- [[nodiscard]] const glm::vec3& getDistanceMax () const;
- /**
- * @return The minimum distance a particle can travel before being dead
- */
- [[nodiscard]] const glm::vec3& getDistanceMin () const;
- /**
- * @return The direction a particle should move to
- */
- [[nodiscard]] const glm::vec3& getDirections () const;
- /**
- * @return The center of the particle emission
- */
- [[nodiscard]] const glm::vec3& getOrigin () const;
- /**
- * @return The rate of particle emission
- */
- [[nodiscard]] const double getRate () const;
- protected:
- CEmitter (const glm::vec3& directions, const glm::vec3& distancemax, const glm::vec3& distancemin, uint32_t id, std::string name,
- const glm::vec3& origin, double rate);
- private:
- /** Direction the particles should move to */
- glm::vec3 m_directions;
- /** Maximum distance before the particle is dead */
- glm::vec3 m_distancemax;
- /** Minimum distance before the particle is dead */
- glm::vec3 m_distancemin;
- /** ID of the emitter */
- uint32_t m_id;
- /** Name of the emitter, indicates the type of emitter */
- std::string m_name;
- /** The center of the emitter */
- glm::vec3 m_origin;
- /** The rate of emission */
- double m_rate;
- };
- } // namespace WallpaperEngine::Core::Objects::Particles
|