Engine
Raylib based game framework
Loading...
Searching...
No Matches
ParticleSystem.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "Engine/Registry.hpp"
6
11
20class ParticleSystem : public System
21{
22public:
23
28
38 void Update(const float deltaT) override;
39
46 void Draw() const override;
47
55 static void Burst(const Entity entity, u32 count);
56
61 static void Stop(const Entity entity);
62
67 static void Play(const Entity entity);
68
69private:
70
71 static void SpawnParticle(const Entity entity, const Component::ParticleEmitter& emitter,
72 const Vec2<float>& worldPos);
73
74 void MarkNeedSort();
75
76 bool m_needSort = false;
77};
Engine components.
Engine entt::registry wrapper.
Engine lifelong systems and their managing.
void Draw() const override
Renders all visible particles.
Definition ParticleSystem.cpp:110
ParticleSystem()
Constructs the system and registers component callbacks.
Definition ParticleSystem.cpp:15
static void Play(const Entity entity)
Resumes automatic spawning on the emitter.
Definition ParticleSystem.cpp:178
void Update(const float deltaT) override
Updates all active particles and spawns new ones.
Definition ParticleSystem.cpp:33
static void Burst(const Entity entity, u32 count)
Instantly spawns a burst of particles.
Definition ParticleSystem.cpp:154
static void Stop(const Entity entity)
Stops automatic spawning on the emitter.
Definition ParticleSystem.cpp:170
Base class for all systems.
Definition SystemManager.hpp:27
Spawn parameters and runtime state for a particle emitter.
Definition Components.hpp:91