diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-20 11:10:06 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-20 11:10:06 +0100 |
commit | 5b1a26a13d8a2f44a7ef1fa8c0fc609c37adc28b (patch) | |
tree | 801ff9f3bbd82efacb5d4fdb1cbe4c09cfedf7c5 /src/crepe/system/ParticleSystem.cpp | |
parent | 88d84763147fbd6bcc087f15a7460566a009cdb2 (diff) | |
parent | 69ca2bafcd617ac8af1b8f715f0c802205a60ab1 (diff) |
merge masterloek/replay
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 bbc7366..5e575e4 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::fixed_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); |