Refine r5330 conditions for stopping car, restore FLOAT_RELAXATION2 in SimWheelUpdateForce

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5335 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 857e3e7e1069745fdbb4205d8e3d4086ebc5b5de
Former-commit-id: 244b23bd78f73d858b4bbbb11c47b942d39d03cf
This commit is contained in:
kakukri 2013-03-20 01:45:27 +00:00
parent 279391a7b7
commit fac30d4c15
2 changed files with 6 additions and 8 deletions

View file

@ -275,8 +275,11 @@ SimCarUpdateForces(tCar *car)
else if ( (desiredTq - F.M.z) > 0.0 ) {F.M.z += 0.5 * w * car->wheelbase;}
else {F.M.z -= 0.5 * w * car->wheelbase;}
/* desired force to really stop the car when braking to 0 */
if ( (car->ctrl->brakeCmd > 0.05) && (fabs(car->DynGC.vel.x) < 0.02) ) {
if ( ((car->ctrl->brakeCmd > 0.05) || (car->ctrl->ebrakeCmd > 0.1) || (car->ctrl->brakeFrontLeftCmd > 0.02)
|| (car->ctrl->brakeFrontRightCmd > 0.02) || (car->ctrl->brakeRearLeftCmd > 0.02) || (car->ctrl->brakeRearRightCmd > 0.02) )
&& (car->ctrl->accelCmd * car->transmission.clutch.transferValue < 0.05) && (fabs(car->DynGC.vel.x) < 0.02) ) {
desiredF = - m * car->DynGC.vel.x / SimDeltaTime;
w *= 0.5;
if ( (fabs(desiredF - F.F.x)) < w ) {F.F.x = desiredF;}
else if ( (desiredF - F.F.x) > 0.0 ) {F.F.x += w;}
else {F.F.x -= w;}

View file

@ -262,13 +262,8 @@ void SimWheelUpdateForce(tCar *car, int index)
Fn -= F * sy / s;
}
if (car->features & FEAT_SLOWGRIP) {
wheel->preFn = Fn;
wheel->preFt = Ft;
} else {
FLOAT_RELAXATION2(Fn, wheel->preFn, 50.0f);
FLOAT_RELAXATION2(Ft, wheel->preFt, 50.0f);
}
FLOAT_RELAXATION2(Fn, wheel->preFn, 50.0f);
FLOAT_RELAXATION2(Ft, wheel->preFt, 50.0f);
wheel->relPos.az = waz;