diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 15:32:07 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 15:32:07 +0100 |
commit | afd81007153f05c8f8b42bcf08a8cdf8ce13a98c (patch) | |
tree | 1c6eec51833d34c06118b1c76f19f035b526d6c6 /src/crepe/api | |
parent | 3de0a0f12d9d91e120f92975bda6f9915e5b8fcb (diff) |
updated particle emitter
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/LoopManager.cpp | 1 | ||||
-rw-r--r-- | src/crepe/api/ParticleEmitter.h | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp index b5e5ff7..7a78019 100644 --- a/src/crepe/api/LoopManager.cpp +++ b/src/crepe/api/LoopManager.cpp @@ -65,6 +65,7 @@ void LoopManager::fixed_update() { this->get_system<InputSystem>().update(); this->event_manager.dispatch_events(); this->get_system<ScriptSystem>().update(); + this->get_system<ParticleSystem>().update(); this->get_system<AISystem>().update(); this->get_system<PhysicsSystem>().update(); this->get_system<CollisionSystem>().update(); diff --git a/src/crepe/api/ParticleEmitter.h b/src/crepe/api/ParticleEmitter.h index 48c7625..cdea69a 100644 --- a/src/crepe/api/ParticleEmitter.h +++ b/src/crepe/api/ParticleEmitter.h @@ -5,6 +5,7 @@ #include "Component.h" #include "Particle.h" +#include "system/ParticleSystem.h" #include "types.h" namespace crepe { @@ -52,8 +53,6 @@ public: const unsigned int max_particles = 256; //! rate of particle emission per update (Lowest value = 0.001 any lower is ignored) float emission_rate = 1; - //! Saves time left over from last update event. - float spawn_accumulator = 0; //! min speed of the particles float min_speed = 1; //! min speed of the particles @@ -85,6 +84,10 @@ public: public: //! Configuration data for particle emission settings. Data data; +private: + //! Saves time left over from last update event. + friend ParticleSystem; + float spawn_accumulator = 0; }; } // namespace crepe |