class
ParticlePool
Particle pool with swap-remove for O(1) particle death
- Module
- Particles
- Header
#include "Particles/ParticlePool.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
ParticlePool() = default | ParticlePool | |
explicit ParticlePool(size_t capacity) | ParticlePool |
Public functions
| Returns | Name | Description |
|---|---|---|
void | Reserve | |
Particle* | Emit | Emit a new particle, returns pointer to particle for initialization Returns nullptr if pool is full |
void | Kill | Kill particle at index (swap with last, pop) |
size_t | Update | Update all particles, killing dead ones Returns number of alive particles |
void | Clear | |
size_t | Count | |
size_t | Capacity | |
bool | IsFull | |
bool | IsEmpty | |
Particle& | operator[] | |
const Particle& | operator[] | |
auto | begin | |
auto | end | |
auto | begin | |
auto | end | |
std::vector<Particle>& | GetParticles | |
const std::vector<Particle>& | GetParticles |
Function details
ParticlePool
C++
ParticlePool() = defaultParticlePool
C++
explicit ParticlePool(size_t capacity)Reserve
C++
void Reserve(size_t capacity)Emit
C++
Particle* Emit()Emit a new particle, returns pointer to particle for initialization Returns nullptr if pool is full
Kill
C++
void Kill(size_t index)Kill particle at index (swap with last, pop)
Update
C++
size_t Update(float deltaTime)Update all particles, killing dead ones Returns number of alive particles
Clear
C++
void Clear()Count
C++
size_t Count() constCapacity
C++
size_t Capacity() constIsFull
C++
bool IsFull() constIsEmpty
C++
bool IsEmpty() constoperator[]
C++
Particle& operator[](size_t index)operator[]
C++
const Particle& operator[](size_t index) constbegin
C++
auto begin()end
C++
auto end()begin
C++
auto begin() constend
C++
auto end() constGetParticles
C++
std::vector<Particle>& GetParticles()GetParticles
C++
const std::vector<Particle>& GetParticles() constGenerated from Particles/ParticlePool.h via particles.json · Oct 31, 2026Version 1.0.0