diff options
author | Max-001 <80035972+Max-001@users.noreply.github.com> | 2024-12-19 21:38:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-19 21:38:04 +0100 |
commit | 1bb9c2ccf96b7d2e24929c693192b25885614df9 (patch) | |
tree | 44184b5472cad44c9b335162177de85802692560 /src/crepe/system/ParticleSystem.cpp | |
parent | 9c11853f7331fd740c763f5cc8f34903526a85d4 (diff) | |
parent | 3894948275e10b6a0e3614ba0da90b9ea8d6cd4e (diff) |
Merge pull request #85 from lonkaars/jaro/collision-system-handeling
Jaro/collision system handeling
Diffstat (limited to 'src/crepe/system/ParticleSystem.cpp')
-rw-r--r-- | src/crepe/system/ParticleSystem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/crepe/system/ParticleSystem.cpp b/src/crepe/system/ParticleSystem.cpp index 35a1d41..e66c603 100644 --- a/src/crepe/system/ParticleSystem.cpp +++ b/src/crepe/system/ParticleSystem.cpp @@ -7,6 +7,7 @@ #include "../api/Transform.h" #include "../manager/ComponentManager.h" #include "../manager/LoopTimerManager.h" +#include "util/AbsolutePosition.h" #include "ParticleSystem.h" @@ -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); |