1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix formula used for acceleration (#12353)

This commit is contained in:
Lars Müller 2022-09-20 10:55:51 +02:00 committed by GitHub
parent 11905a6db6
commit 1317cd12d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 16 deletions

View file

@ -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) {