Use sim provided slip ratio if available for slip based effects

This commit is contained in:
Paul Dino Jones 2026-03-17 10:32:27 -04:00
parent f21bced7c6
commit 925cb0a2f1
1 changed files with 51 additions and 34 deletions

View File

@ -204,6 +204,14 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
wheelslip[2] = 0;
wheelslip[3] = 0;
int sim_slip_ratio =0;
for (int i = 0; i < 4; i++)
{
sim_slip_ratio = abs(simdata->tyreslipratio[i]);
}
if(sim_slip_ratio == 0)
{
slogt("wheel vibration calculation with wheel config set to %i configchecked %i configfile %s car %s sim %i", useconfig, *configcheck, configfile, simdata->car, simdata->simexe);
switch (effecttype)
@ -240,7 +248,6 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
default:
slogd("Unknown effect type");
}
if(simdata->Yvelocity <= 0)
{
return 0;
@ -249,6 +256,16 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
{
return 0;
}
}
else
{
for (int i = 0; i < 4; i++)
{
wheelslip[i] = simdata->tyreslipratio[i];
}
slogt("wheelslip values from sim are %f %f %f %f", wheelslip[0], wheelslip[1], wheelslip[2], wheelslip[3]);
}
switch (effecttype)
{