diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2022-09-20 10:55:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 10:55:51 +0200 |
commit | 1317cd12d74dba4ff765d6e18b0b30cdf42002a3 (patch) | |
tree | 417fcd478cf89fbf4912f816bec13cf8a4b6a9c5 /src/client/particles.cpp | |
parent | 11905a6db65e70c84683098711ce36958968c6c3 (diff) | |
download | minetest-1317cd12d74dba4ff765d6e18b0b30cdf42002a3.tar.xz |
Fix formula used for acceleration (#12353)
Diffstat (limited to 'src/client/particles.cpp')
-rw-r--r-- | src/client/particles.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |