From 4c1874ebf86ab6cd85dc92846cda0e83fa7a2fba Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 23 Oct 2017 08:44:17 +1100 Subject: [PATCH] Hopefully fix #2939 (backpedal animation flickers when stopping and left/right is being pressed). --- src/physics/btKart.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/physics/btKart.cpp b/src/physics/btKart.cpp index b84bc6e6b..bc11d6ef5 100644 --- a/src/physics/btKart.cpp +++ b/src/physics/btKart.cpp @@ -705,7 +705,9 @@ btScalar btKart::calcRollingFriction(btWheelContactPoint& contactPoint) btScalar vrel = contactPoint.m_frictionDirectionWorld.dot(vel); // calculate j that moves us to zero relative velocity - btScalar j1 = -vrel * contactPoint.m_jacDiagABInv; + // Note that num_wheels_on_ground > 0 since this function is called + // for wheels that touch the ground/ + btScalar j1 = -vrel * contactPoint.m_jacDiagABInv / m_num_wheels_on_ground; btSetMin(j1, maxImpulse); btSetMax(j1, -maxImpulse);