Skip to content

Commit

Permalink
fix: emitter does not skip particles
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Nov 9, 2024
1 parent 82733d3 commit 983e516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graphics/render/Emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void Emitter::update(
return;
}
}
timer += delta;
const float maxDistance = preset.maxDistance;
if (glm::distance2(position, cameraPosition) > maxDistance * maxDistance) {
if (count > 0) {
Expand All @@ -77,7 +78,6 @@ void Emitter::update(
}
return;
}
timer += delta;
while (count && timer > spawnInterval) {
// spawn particle
Particle particle = prototype;
Expand Down

0 comments on commit 983e516

Please sign in to comment.