aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-13 18:49:51 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-13 18:49:51 +0100
commit5ad9f5c81ae20f4b7aa2c1773bce8906096754f3 (patch)
tree7ec1a6363518998bd15895513314143457b73123 /src
parent68f7ea611af5b9a4c19375ab3d4a351facdea9a9 (diff)
friend explained
Diffstat (limited to 'src')
-rw-r--r--src/crepe/Particle.h2
-rw-r--r--src/crepe/api/ParticleEmitter.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/crepe/Particle.h b/src/crepe/Particle.h
index 49fec1f..0170117 100644
--- a/src/crepe/Particle.h
+++ b/src/crepe/Particle.h
@@ -14,8 +14,6 @@ namespace crepe {
* can also be reset or stopped.
*/
class Particle {
- // TODO: add friend particleSsytem and rendersystem. Unit test will fail.
-
public:
//! Position of the particle in 2D space.
vec2 position;
diff --git a/src/crepe/api/ParticleEmitter.h b/src/crepe/api/ParticleEmitter.h
index e0b117a..5b8e8e3 100644
--- a/src/crepe/api/ParticleEmitter.h
+++ b/src/crepe/api/ParticleEmitter.h
@@ -54,11 +54,11 @@ public:
//! maximum number of particles
const unsigned int max_particles = 256;
//! rate of particle emission per second
- float emission_rate = 1;
+ float emission_rate = 50;
//! min speed of the particles
- float min_speed = 1;
+ float min_speed = 100;
//! min speed of the particles
- float max_speed = 2;
+ float max_speed = 100;
//! min angle of particle emission
float min_angle = 0;
//! max angle of particle emission
@@ -84,9 +84,11 @@ public:
//! Configuration data for particle emission settings.
Data data;
private:
- //! Saves time left over from last update event.
+ //! Only ParticleSystem can move and read particles
friend ParticleSystem;
+ //! Only RenderSystem can read particles
friend RenderSystem;
+ //! Saves time left over from last update event.
float spawn_accumulator = 0;
//! collection of particles
std::vector<Particle> particles;