Fixed #550: zippers have much less effect.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10909 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2012-02-29 09:10:16 +00:00
parent 1e90311e5e
commit 650af20260

View File

@ -700,34 +700,36 @@ void btKart::updateFriction(btScalar timeStep)
}
}
btScalar rollingFriction = 0.f;
if (wheelInfo.m_engineForce != 0.f)
{
rollingFriction = wheelInfo.m_engineForce* timeStep;
}
else
{
btScalar defaultRollingFrictionImpulse = 0.f;
btScalar maxImpulse = wheelInfo.m_brake
? wheelInfo.m_brake
: defaultRollingFrictionImpulse;
btWheelContactPoint contactPt(m_chassisBody, groundObject,
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;
}
btScalar rollingFriction = 0.f;
m_forwardImpulse[wheel] = rollingFriction;
if (wheelInfo.m_engineForce != 0.f)
{
rollingFriction = wheelInfo.m_engineForce* timeStep;
}
else
{
btScalar defaultRollingFrictionImpulse = 0.f;
btScalar maxImpulse = wheelInfo.m_brake
? wheelInfo.m_brake
: defaultRollingFrictionImpulse;
btWheelContactPoint contactPt(m_chassisBody, groundObject,
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;
}
m_forwardImpulse[wheel] = rollingFriction;
}
if(m_time_additional_impulse>0)
{
sliding = true;