From 1317cd12d74dba4ff765d6e18b0b30cdf42002a3 Mon Sep 17 00:00:00 2001 From: Lars Müller <34514239+appgurueu@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:55:51 +0200 Subject: Fix formula used for acceleration (#12353) --- src/client/particles.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client/particles.cpp') diff --git a/src/client/particles.cpp b/src/client/particles.cpp index 85baee7cd..99723d8d6 100644 --- a/src/client/particles.cpp +++ b/src/client/particles.cpp @@ -217,9 +217,10 @@ void Particle::step(float dtime) } m_pos = p_pos / BS; } else { - // apply acceleration + // apply velocity and acceleration to position + m_pos += (m_velocity + m_acceleration * 0.5f * dtime) * dtime; + // apply acceleration to velocity m_velocity += m_acceleration * dtime; - m_pos += m_velocity * dtime; } if (m_animation.type != TAT_NONE) { -- cgit v1.2.3