Re-added support for track connection acceleration (for backward

compatibility).


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

View File

@@ -478,7 +478,15 @@ void btKart::updateSuspension(btScalar deltaTime)
btWheelInfo &wheel_info = m_wheelInfo[w_it];
if ( !wheel_info.m_raycastInfo.m_isInContact )
{
wheel_info.m_wheelsSuspensionForce = btScalar(0.0);
// A very unphysical thing to handle slopes that are a bit too
// steep or uneven (resulting in only one wheel on the ground)
// If only the front or only the rear wheels are on the ground, add
// a force pulling the axis down (towards the ground). Note that it
// is already guaranteed that either both or no wheels on one axis
// are on the ground, so we have to test only one of the wheels
wheel_info.m_wheelsSuspensionForce =
-m_kart->getKartProperties()->getTrackConnectionAccel()
* chassisMass;
continue;
}