From bce1f45a2b9de00a1d9a54e04a283aa624358b11 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 29 Dec 2020 15:52:31 +0100 Subject: [PATCH] Respect possible particle size increase, of worst case rotation --- src/game/client/components/particles.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/client/components/particles.cpp b/src/game/client/components/particles.cpp index f8ae0ac4c..7c156675c 100644 --- a/src/game/client/components/particles.cpp +++ b/src/game/client/components/particles.cpp @@ -177,6 +177,10 @@ bool CParticles::ParticleIsVisibleOnScreen(const vec2 &CurPos, float CurSize) float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); + // for simplicity assume the worst case rotation, that increases the bounding box around the particle by its diagonal + const float SqrtOf2 = sqrtf(2); + CurSize = SqrtOf2 * CurSize; + // always uses the mid of the particle float SizeHalf = CurSize / 2;