Adding braking improvement back in.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/physics@10253 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2011-11-24 10:29:14 +00:00
parent dccbfaa5f2
commit 8890925470

View File

@@ -678,6 +678,14 @@ void btKart::updateFriction(btScalar timeStep)
wheelInfo.m_raycastInfo.m_contactPointWS,
m_forwardWS[wheel],maxImpulse);
rollingFriction = calcRollingFriction(contactPt);
// This is a work around for the problem that a kart shakes
// if it is braking: we get a minor impulse forward, which
// bullet then tries to offset by applying a backward
// impulse - which is a bit too big, causing a impulse
// backwards, ... till the kart is shaking backwards and
// forwards
if(wheelInfo.m_brake && fabsf(rollingFriction)<10)
rollingFriction=0;
}
//switch between active rolling (throttle), braking and non-active