vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
particle_system.h
1#pragma once
2
3#include "core/math/random.h"
4#include "core/system.h"
5#include "system/particle/live_particles.h"
6
7namespace Vkm::Engine {
8
18class ParticleSystem : public System {
19 public:
20 ParticleSystem() = default;
21 ~ParticleSystem() override = default;
22
23 ParticleSystem(const ParticleSystem& other) = delete;
24 ParticleSystem& operator=(const ParticleSystem& other) = delete;
25
26 ParticleSystem(ParticleSystem && other) = delete;
27 ParticleSystem& operator=(ParticleSystem && other) = delete;
28
29 public:
30 void update(FrameContext& ctx) override;
31
32 private:
33 static constexpr uint64_t SEED = 0x9E3779B97F4A7C15ULL;
34
35 private:
43 Math::Rng m_rng{SEED};
44
45 LiveParticles m_live;
46 uint64_t m_step = 0;
47 uint64_t m_epoch = 0;
48};
49
50} // namespace Vkm::Engine
PCG32 pseudo-random generator (O'Neill, 2014).
Definition random.h:12
void update(FrameContext &ctx) override
Execute this system for the current frame.
Per-frame state bundle passed to every system.
Definition system.h:55
Every emitter's live particles: ParticleSystem's per-frame product.
Definition live_particles.h:30