1
0
Fork 0

Integrate code posted by Jon Berndt, so that only the z-direction

turbulence is diminished near the ground.
This commit is contained in:
david 2003-02-12 23:00:49 +00:00
parent 0a6d2b7559
commit 2412c3a334

View file

@ -271,24 +271,21 @@ void FGAtmosphere::Turbulence(void)
MagnitudeAccel += MagnitudedAccelDt*rate*State->Getdt();
Magnitude += MagnitudeAccel*rate*State->Getdt();
// Fade the magnitude within two wingspans
// of the ground (WAG)
double AdjustedMagnitude = Magnitude;
double AdjustedMagnitudeAccel = MagnitudeAccel;
double HOverBMAC = Position->GetHOverBMAC();
if (HOverBMAC < 2.0) {
AdjustedMagnitude *= (HOverBMAC / 2.0);
AdjustedMagnitudeAccel *= (HOverBMAC / 2.0);
}
vDirectiondAccelDt.Normalize();
vDirectionAccel += vDirectiondAccelDt*rate*State->Getdt();
vDirectionAccel.Normalize();
vDirection += vDirectionAccel*rate*State->Getdt();
// Diminish z-vector within two wingspans
// of the ground
double HOverBMAC = Position->GetHOverBMAC();
if (HOverBMAC < 2.0)
vDirection(eZ) *= HOverBMAC / 2.0;
vDirection.Normalize();
vTurbulence = TurbGain*AdjustedMagnitude * vDirection;
vTurbulenceGrad = TurbGain*AdjustedMagnitudeAccel * vDirection;
vTurbulence = TurbGain*Magnitude * vDirection;
vTurbulenceGrad = TurbGain*MagnitudeAccel * vDirection;
vBodyTurbGrad = State->GetTl2b()*vTurbulenceGrad;
vTurbPQR(eP) = vBodyTurbGrad(eY)/Aircraft->GetWingSpan();