1
0
Fork 0

Blindingly stupid ground effect bug. It interpolated in the wrong direction

(zero at ground, maximum at 1-span!)
This commit is contained in:
andy 2002-11-05 21:36:47 +00:00
parent dd10ae6ba8
commit 7b7de3d3e0
2 changed files with 4 additions and 3 deletions

View file

@ -582,7 +582,7 @@ void Airplane::compile()
// Ground effect
float gepos[3];
float gespan = _wing->getGroundEffect(gepos);
_model.setGroundEffect(gepos, gespan, 0.3f);
_model.setGroundEffect(gepos, gespan, 0.15f);
solveGear();
solve();

View file

@ -260,8 +260,9 @@ void Model::calcForces(State* s)
float dist = ground[3] - Math::dot3(ground, _wingCenter);
if(dist > 0 && dist < _groundEffectSpan) {
float fz = Math::dot3(faero, ground);
Math::mul3(fz * _groundEffect * dist/_groundEffectSpan,
ground, faero);
fz *= (_groundEffectSpan - dist) / _groundEffectSpan;
fz *= _groundEffect;
Math::mul3(fz, ground, faero);
_body.addForce(faero);
}