diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-20 12:01:36 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-20 12:01:36 +0100 |
commit | 79d3a9f4311e6684b6df83a15ca7844f58c1959c (patch) | |
tree | b2883e83f61cee9edf290a6a7228c7f0b1fbae8a /src/crepe/system/ParticleSystem.cpp | |
parent | 9140b73e4af7aa925b53e4fb4e6aa7f4ea2e3385 (diff) | |
parent | 03aea832aa0bc2edba2cc5ab4d9f8eba42d355be (diff) |
Merge remote-tracking branch 'origin/master' into max/game
Diffstat (limited to 'src/crepe/system/ParticleSystem.cpp')
-rw-r--r-- | src/crepe/system/ParticleSystem.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/crepe/system/ParticleSystem.cpp b/src/crepe/system/ParticleSystem.cpp index 35a1d41..5e575e4 100644 --- a/src/crepe/system/ParticleSystem.cpp +++ b/src/crepe/system/ParticleSystem.cpp @@ -7,12 +7,13 @@ #include "../api/Transform.h" #include "../manager/ComponentManager.h" #include "../manager/LoopTimerManager.h" +#include "util/AbsolutePosition.h" #include "ParticleSystem.h" using namespace crepe; -void ParticleSystem::update() { +void ParticleSystem::fixed_update() { // Get all emitters const Mediator & mediator = this->mediator; LoopTimerManager & loop_timer = mediator.loop_timer; @@ -48,9 +49,10 @@ void ParticleSystem::update() { void ParticleSystem::emit_particle(ParticleEmitter & emitter, const Transform & transform) { constexpr float DEG_TO_RAD = M_PI / 180.0; - vec2 initial_position = emitter.data.offset + transform.position; + vec2 initial_position = AbsolutePosition::get_position(transform, emitter.data.offset); float random_angle - = this->generate_random_angle(emitter.data.min_angle, emitter.data.max_angle); + = this->generate_random_angle(emitter.data.min_angle + transform.rotation, + emitter.data.max_angle + transform.rotation); float random_speed = this->generate_random_speed(emitter.data.min_speed, emitter.data.max_speed); |