Updates and draws particles emitted by entities.
More...
#include <ParticleSystem.hpp>
|
|
| ParticleSystem () |
| | Constructs the system and registers component callbacks.
|
| void | Update (const float deltaT) override |
| | Updates all active particles and spawns new ones.
|
| void | Draw () const override |
| | Renders all visible particles.
|
|
| static void | Burst (const Entity entity, u32 count) |
| | Instantly spawns a burst of particles.
|
| static void | Stop (const Entity entity) |
| | Stops automatic spawning on the emitter.
|
| static void | Play (const Entity entity) |
| | Resumes automatic spawning on the emitter.
|
Updates and draws particles emitted by entities.
Requires entities to have a Component::ParticleEmitter and a std::vector<Component::Particle>. Handles spawning, physics, aging, and texture‑sorted rendering.
◆ Burst()
| void ParticleSystem::Burst |
( |
const Entity | entity, |
|
|
u32 | count ) |
|
static |
Instantly spawns a burst of particles.
- Parameters
-
| entity | Entity holding the ParticleEmitter. |
| count | Number of particles to spawn. |
Does nothing if entity lacks ParticleEmitter or Transform.
◆ Draw()
| void ParticleSystem::Draw |
( |
| ) |
const |
|
overridevirtual |
Renders all visible particles.
Interpolates color and size based on age/lifetime. Uses DrawTexturePro if a valid texture is provided, otherwise falls back to circles.
Reimplemented from System.
◆ Play()
| void ParticleSystem::Play |
( |
const Entity | entity | ) |
|
|
static |
Resumes automatic spawning on the emitter.
- Parameters
-
| entity | Entity with ParticleEmitter. |
◆ Stop()
| void ParticleSystem::Stop |
( |
const Entity | entity | ) |
|
|
static |
Stops automatic spawning on the emitter.
- Parameters
-
| entity | Entity with ParticleEmitter. |
◆ Update()
| void ParticleSystem::Update |
( |
const float | deltaT | ) |
|
|
overridevirtual |
Updates all active particles and spawns new ones.
- Parameters
-
| deltaT | Time since last update (seconds). |
- Applies velocity, gravity, angular velocity and aging.
- Removes expired particles.
- If emitter is playing, spawns particles at the given rate.
- Marks sort dirty when particles change.
Implements System.
The documentation for this class was generated from the following files: