Respect possible particle size increase, of worst case rotation

This commit is contained in:
Jupeyy 2020-12-29 15:52:31 +01:00
parent 505656313c
commit bce1f45a2b

View file

@ -177,6 +177,10 @@ bool CParticles::ParticleIsVisibleOnScreen(const vec2 &CurPos, float CurSize)
float ScreenX0, ScreenY0, ScreenX1, ScreenY1; float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
Graphics()->GetScreen(&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 // always uses the mid of the particle
float SizeHalf = CurSize / 2; float SizeHalf = CurSize / 2;