aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/ParticleSystem.h
diff options
context:
space:
mode:
authorJaro <jarorutjes07@gmail.com>2024-11-08 19:20:05 +0100
committerJaro <jarorutjes07@gmail.com>2024-11-08 19:20:05 +0100
commitd69adb5666fd6f73edbc6d410afcdf23c24e7c6b (patch)
tree00dd0280e603be5f67753fa1171582109b1065c4 /src/crepe/system/ParticleSystem.h
parent0feda3d123ff99a1b9e41837482268bebfd9140a (diff)
particle updated
Diffstat (limited to 'src/crepe/system/ParticleSystem.h')
-rw-r--r--src/crepe/system/ParticleSystem.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/crepe/system/ParticleSystem.h b/src/crepe/system/ParticleSystem.h
index 3ac1d3f..3b9cb54 100644
--- a/src/crepe/system/ParticleSystem.h
+++ b/src/crepe/system/ParticleSystem.h
@@ -10,9 +10,15 @@ public:
void update();
private:
- void emit_particle(ParticleEmitter & emitter); //emits a new particle
+ void emit_particle(ParticleEmitter & emitter,const Transform& transform);
+ int calculate_update(int count, double emission);
+ void check_bounds(ParticleEmitter & emitter,const Transform& transform);
- float elapsed_time; //elapsed time since the last emission
+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