38class ParticleSystem :
public System {
43 ParticleSystem() =
default;
44 ~ParticleSystem()
override =
default;
46 ParticleSystem(
const ParticleSystem& other) =
delete;
47 ParticleSystem& operator=(
const ParticleSystem& other) =
delete;
49 ParticleSystem(ParticleSystem && other) =
delete;
50 ParticleSystem& operator=(ParticleSystem && other) =
delete;
64 static glm::vec3
swirlAt(
const glm::vec3& position,
float time);
67 static constexpr uint64_t SEED = 0x9E3779B97F4A7C15ULL;
70 struct TriggeredSpawn {
82 float inheritVelocity;
103 LiveParticles::Pool& pool,
104 const ParticleEmitter& emitter,
105 const Origin& origin,
116 void trigger(EntityId emitter, ParticleEvent event,
const Particle& particle);
124 std::pair<const ChildLink*, const ChildLink*> childrenOf(uint32_t slot)
const;
132 bool quiet(uint32_t slot)
const;
146 const ParticleEmitter& emitter,
147 LiveParticles::Pool& pool,
159 Math::Rng m_rng{SEED};
161 LiveParticles m_live;
163 uint64_t m_epoch = 0;
166 std::vector<EntityId> m_spent;
169 std::vector<ChildLink> m_links;
170 std::vector<TriggeredSpawn> m_triggered;
void update(FrameContext &ctx) override
Execute this system for the current frame.
static constexpr float SWIRL_REACH
The most any axis of swirlAt reaches.
Definition particle_system.h:40
static glm::vec3 swirlAt(const glm::vec3 &position, float time)
The swirl the turbulence pushes along, at position and time.
Per-frame state bundle passed to every system.
Definition system.h:57
Makes a child entity's ParticleEmitter a sub-emitter of its parent's.
Definition particle_emitter.h:165