Fixed uninitialised variable.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6719 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-11-25 00:51:47 +00:00
parent 8e519d1959
commit f93d8dc66c
2 changed files with 9 additions and 7 deletions

View File

@@ -1251,11 +1251,12 @@ void Kart::updatePhysics(float dt)
m_skid_sound->stop();
}
// dynamically determine friction so that the kart looses its traction when trying to drive on too steep surfaces
// Below angles of 0.25 rad, you have full traction; above 0.5 rad angles you have absolutely none; inbetween
// there is a linear change in friction
// dynamically determine friction so that the kart looses its traction
// when trying to drive on too steep surfaces. Below angles of 0.25 rad,
// you have full traction; above 0.5 rad angles you have absolutely none;
// inbetween there is a linear change in friction
float friction = 1.0f;
bool enableSkidding = false;
bool enable_skidding = false;
// If a material has friction of more than 10000 treat this
// as no-skidding possible. This way the current skidding
@@ -1276,7 +1277,7 @@ void Kart::updatePhysics(float dt)
if (distanceFromUp < 0.85f)
{
friction = 0.0f;
enableSkidding = true;
enable_skidding = true;
}
else if (distanceFromUp > 0.9f)
{
@@ -1285,7 +1286,7 @@ void Kart::updatePhysics(float dt)
else
{
friction = (distanceFromUp - 0.85f) / 0.5f;
enableSkidding = true;
enable_skidding = true;
}
}
@@ -1295,7 +1296,7 @@ void Kart::updatePhysics(float dt)
wheel.m_frictionSlip = friction*m_kart_properties->getFrictionSlip();
}
m_vehicle->enableSliding(enableSkidding);
m_vehicle->enableSliding(enable_skidding);
/*

View File

@@ -41,6 +41,7 @@ btKart::btKart(const btVehicleTuning& tuning,btRigidBody* chassis,
m_zipper_active = false;
m_zipper_velocity = btScalar(0);
m_allow_sliding = false;
}
// ----------------------------------------------------------------------------