From 78505d2a8b7db9fc5e8b9fd67d2a79223c0596c1 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 24 Nov 2011 10:20:12 +0000 Subject: [PATCH] Added lost improvement: make sure that both wheels of an axis are touching the ground if at least one wheel touches it (if only one wheel touches the ground, the kart will get a strong angular impulse and turn rapidly). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/physics@10251 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/physics/btKart.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/physics/btKart.cpp b/src/physics/btKart.cpp index e53c7bb6d..2266d2d99 100644 --- a/src/physics/btKart.cpp +++ b/src/physics/btKart.cpp @@ -326,6 +326,30 @@ void btKart::updateVehicle( btScalar step ) if(m_wheelInfo[i].m_raycastInfo.m_isInContact) m_num_wheels_on_ground++; } + // Work around: make sure that either both wheels on one axis + // are on ground, or none of them. This avoids the problem of + // the kart suddenly getting additional angular velocity because + // e.g. only one rear wheel is on the ground. + for(i=0; i