Reduce low-speed tire sliőp oscillations.

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

Former-commit-id: 351a8f83bfcf8ea3979bfd5f9009df6c4ca729bb
Former-commit-id: 286506fd12b4983b84c9af0cd21aee132c3c2e21
This commit is contained in:
kakukri 2015-12-29 23:44:28 +00:00
parent 2433f4a7bb
commit 0bc4861131

View file

@ -374,7 +374,7 @@ void SimWheelUpdateForce(tCar *car, int index)
Ft = 0.0f;
Fn = 0.0f;
s = sqrt(sx*sx+sy*sy);
s = sqrt(sx*sx+sy*sy);//printf("%d sx=%g sy=%g vt=%g wrl=%g sV=%g ", index,sx,sy,vt,wrl,wheel->spinVel);
{
// calculate _skid and _reaction for sound.
@ -421,18 +421,17 @@ void SimWheelUpdateForce(tCar *car, int index)
// wheel axis based
Ft -= F * sx / s;
Fn -= F * sy / s;
} else {
Ft -=F;
}
FLOAT_RELAXATION2(Fn, wheel->preFn, 50.0f);
FLOAT_RELAXATION2(Ft, wheel->preFt, 50.0f);
wheel->relPos.az = waz;
wheel->forces.x = Ft * CosA - Fn * SinA;
wheel->forces.y = Ft * SinA + Fn * CosA;
wheel->spinTq = Ft * wheel->radius;
wheel->sa = sa;
wheel->sx = sx;
wheel->sx = sx;//printf("Tq=%g\n",wheel->spinTq);
wheel->feedBack.spinVel = wheel->spinVel;
wheel->feedBack.Tq = wheel->spinTq;
@ -526,7 +525,7 @@ SimWheelUpdateRotation(tCar *car)
/*update rotation*/
wheel->spinVel = wheel->in.spinVel;
if ( (car->features & FEAT_SLOWGRIP) && (wheel->brake.Tq == 0.0) && (car->ctrl->accelCmd * car->transmission.clutch.transferValue < 0.05) ) {
if ( (car->features & FEAT_SLOWGRIP) && (wheel->brake.Tq <= 1.0) && (car->ctrl->accelCmd * car->transmission.clutch.transferValue < 0.05) ) {
/* prevent wheelspin value oscillating around wheel tangential velocity */
tdble waz = wheel->steer + wheel->staticPos.az;
tdble vt = wheel->bodyVel.x * cos(waz) + wheel->bodyVel.y * sin(waz);