Fixed reverse camera (smooth speed was positive even when

going backwards).
This commit is contained in:
hiker 2016-10-05 13:31:31 +11:00
parent 8949e89809
commit ceb961ae87

View File

@ -1566,8 +1566,6 @@ void Kart::updateSpeed()
// only in the order of centimetres though). Smoothing the speed value
// gets rid of this jitter, and also r
m_speed = getVehicle()->getRigidBody()->getLinearVelocity().length();
float f = 0.3f;
m_smoothed_speed = f*m_speed + (1.0f - f)*m_smoothed_speed;
// calculate direction of m_speed
const btTransform& chassisTrans = getVehicle()->getChassisWorldTransform();
@ -1581,6 +1579,9 @@ void Kart::updateSpeed()
m_speed = -m_speed;
}
float f = 0.3f;
m_smoothed_speed = f*m_speed + (1.0f - f)*m_smoothed_speed;
// At low velocity, forces on kart push it back and forth so we ignore this
// - quick'n'dirty workaround for bug 1776883
if (fabsf(m_speed) < 0.2f ||