aboutsummaryrefslogtreecommitdiff
path: root/src/client/particles.cpp
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2022-09-20 10:55:51 +0200
committerGitHub <noreply@github.com>2022-09-20 10:55:51 +0200
commit1317cd12d74dba4ff765d6e18b0b30cdf42002a3 (patch)
tree417fcd478cf89fbf4912f816bec13cf8a4b6a9c5 /src/client/particles.cpp
parent11905a6db65e70c84683098711ce36958968c6c3 (diff)
downloadminetest-1317cd12d74dba4ff765d6e18b0b30cdf42002a3.tar.xz
Fix formula used for acceleration (#12353)
Diffstat (limited to 'src/client/particles.cpp')
-rw-r--r--src/client/particles.cpp5
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) {