forked from speed-dreams/speed-dreams-code
SimuV4 Update cleanup, smoothed downforce cut
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5200 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: a0f4d61a07629979a4cb9c10e549754af271f5e2 Former-commit-id: d3ee7eff4035cfddf4a0a6cff3a30389e8a40ccd
This commit is contained in:
parent
08ff852c58
commit
ec5d0de138
2 changed files with 39 additions and 6 deletions
|
@ -152,16 +152,26 @@ SimWingUpdate(tCar *car, int index, tSituation* s)
|
||||||
// the sinus of the angle of attack
|
// the sinus of the angle of attack
|
||||||
tdble sinaoa = sin(aoa);
|
tdble sinaoa = sin(aoa);
|
||||||
|
|
||||||
if (car->DynGC.vel.x > 0.0f) {
|
if (car->DynGC.vel.x > 0.0f)
|
||||||
|
{
|
||||||
// make drag always negative and have a minimal angle of attack
|
// make drag always negative and have a minimal angle of attack
|
||||||
wing->forces.x = (tdble) (wing->Kx * vt2 * (1.0f + (tdble)car->dammage / 10000.0) * MAX(fabs(sinaoa), 0.02));
|
wing->forces.x = (tdble) (wing->Kx * vt2 * (1.0f + (tdble)car->dammage / 10000.0) * MAX(fabs(sinaoa), 0.02));
|
||||||
// If angle of attack is too large, no downforce, only drag
|
// If angle of attack is too large, no downforce, only drag
|
||||||
if (fabs(aoa) < PI_4)
|
if (fabs(aoa) > PI_2)
|
||||||
wing->forces.z = wing->Kz * vt2 * sinaoa;
|
{
|
||||||
else
|
|
||||||
wing->forces.z = 0.0;
|
wing->forces.z = 0.0;
|
||||||
} else {
|
|
||||||
wing->forces.x = wing->forces.z = 0.0f;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (fabs(aoa) > PI_4)
|
||||||
|
{
|
||||||
|
aoa = (float) MIN(PI_4,MAX(0.0,(1.2 *(PI_2 - aoa))));
|
||||||
|
sinaoa = sin(aoa);
|
||||||
|
}
|
||||||
|
wing->forces.z = (float) MAX(0.0,wing->Kz * vt2 * sinaoa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
wing->forces.x = wing->forces.z = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,29 @@ ctrlCheck(tCar *car)
|
||||||
car->ctrl->wingRearCmd = 0.0;
|
car->ctrl->wingRearCmd = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (car->ctrl->brakeFrontLeftCmd < 0) {
|
||||||
|
car->ctrl->brakeFrontLeftCmd = 0;
|
||||||
|
} else if (car->ctrl->brakeFrontLeftCmd > 1.0f) {
|
||||||
|
car->ctrl->brakeFrontLeftCmd = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (car->ctrl->brakeFrontRightCmd < 0) {
|
||||||
|
car->ctrl->brakeFrontRightCmd = 0;
|
||||||
|
} else if (car->ctrl->brakeFrontRightCmd > 1.0f) {
|
||||||
|
car->ctrl->brakeFrontRightCmd = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (car->ctrl->brakeRearLeftCmd < 0) {
|
||||||
|
car->ctrl->brakeRearLeftCmd = 0;
|
||||||
|
} else if (car->ctrl->brakeRearLeftCmd > 1.0f) {
|
||||||
|
car->ctrl->brakeRearLeftCmd = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (car->ctrl->brakeRearRightCmd < 0) {
|
||||||
|
car->ctrl->brakeRearRightCmd = 0;
|
||||||
|
} else if (car->ctrl->brakeRearRightCmd > 1.0f) {
|
||||||
|
car->ctrl->brakeRearRightCmd = 1.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initial configuration */
|
/* Initial configuration */
|
||||||
|
|
Loading…
Reference in a new issue