Solves #157: change the handling of negative angle of attack in SimWingUpdate
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3283 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 5e304c1eca61abe6ee10c3b97f518587206fb269 Former-commit-id: 0e79638e22fede409f751d3d5678b22b9b64051a
This commit is contained in:
parent
fe9102fdf7
commit
61926974f5
1 changed files with 10 additions and 12 deletions
|
@ -137,19 +137,17 @@ SimWingUpdate(tCar *car, int index, tSituation* s)
|
||||||
tdble vt2 = car->airSpeed2;
|
tdble vt2 = car->airSpeed2;
|
||||||
// compute angle of attack
|
// compute angle of attack
|
||||||
tdble aoa = atan2(car->DynGC.vel.z, car->DynGC.vel.x) + car->DynGCg.pos.ay;
|
tdble aoa = atan2(car->DynGC.vel.z, car->DynGC.vel.x) + car->DynGCg.pos.ay;
|
||||||
if (aoa < 0) {
|
|
||||||
wing->forces.x = wing->forces.z = 0;
|
|
||||||
} else {
|
|
||||||
aoa += wing->angle;
|
|
||||||
// the sinus of the angle of attack
|
|
||||||
tdble sinaoa = sin(aoa);
|
|
||||||
|
|
||||||
if (car->DynGC.vel.x > 0.0f) {
|
aoa += wing->angle;
|
||||||
wing->forces.x = wing->Kx * vt2 * (1.0f + (tdble)car->dammage / 10000.0) * sinaoa;
|
// the sinus of the angle of attack
|
||||||
wing->forces.z = wing->Kz * vt2 * sinaoa;
|
tdble sinaoa = sin(aoa);
|
||||||
} else {
|
|
||||||
wing->forces.x = wing->forces.z = 0.0f;
|
if (car->DynGC.vel.x > 0.0f) {
|
||||||
}
|
//make drag always negative and have a minimal angle of attack
|
||||||
|
wing->forces.x = wing->Kx * vt2 * (1.0f + (tdble)car->dammage / 10000.0) * MAX(fabs(sinaoa), 0.02);
|
||||||
|
wing->forces.z = wing->Kz * vt2 * sinaoa;
|
||||||
|
} else {
|
||||||
|
wing->forces.x = wing->forces.z = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue