aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/ParticleSystem.h
blob: 3b9cb5447bc5c662720dba06f2766876d2ad4be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "../api/ParticleEmitter.h"

namespace crepe {

class ParticleSystem {
public:
	ParticleSystem();
	void update();

private:
	void emit_particle(ParticleEmitter & emitter,const Transform& transform);
	int calculate_update(int count, double emission);
	void check_bounds(ParticleEmitter & emitter,const Transform& transform);

private:
	//! counter to count updates to determine how many times emit_particle is called.
	uint32_t update_count = 0;
	//! determines the lowest amount of emissionrate (1000 = 0.001 = 1 particle per 1000 updates).
	const uint32_t MAX_UPDATE_COUNT = 100;
};

} // namespace crepe