-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleSystem.h
More file actions
32 lines (26 loc) · 909 Bytes
/
ParticleSystem.h
File metadata and controls
32 lines (26 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <vector>
#include "DekiParticlesAPI.h"
class ParticleEmitterComponent;
/**
* @brief Lightweight registry of live particle emitters.
*
* Mirrors AnimationSystem in shape. Existence is justified by play-mode-stop
* cleanup: when the editor stops Play, this clears all emitter pointers so
* stale references don't leak into the next session.
*
* Per-frame simulation is driven from ParticleEmitterComponent::Update() —
* this class does NOT iterate emitters per frame.
*/
class DEKI_PARTICLES_API ParticleSystem
{
public:
static ParticleSystem& GetInstance();
void RegisterEmitter(ParticleEmitterComponent* emitter);
void UnregisterEmitter(ParticleEmitterComponent* emitter);
void ClearAll();
int EmitterCount() const { return (int)m_Emitters.size(); }
private:
ParticleSystem() = default;
std::vector<ParticleEmitterComponent*> m_Emitters;
};