Fade out the turbulence within two wingspans of the ground.
This commit is contained in:
parent
4ecd146258
commit
9f5498acf4
1 changed files with 14 additions and 3 deletions
|
@ -261,7 +261,7 @@ void FGAtmosphere::Calculate(double altitude)
|
|||
void FGAtmosphere::Turbulence(void)
|
||||
{
|
||||
switch (turbType) {
|
||||
case ttBerndt:
|
||||
case ttBerndt: {
|
||||
vDirectiondAccelDt(eX) = 1 - 2.0*(((double)(rand()))/RAND_MAX);
|
||||
vDirectiondAccelDt(eY) = 1 - 2.0*(((double)(rand()))/RAND_MAX);
|
||||
vDirectiondAccelDt(eZ) = 1 - 2.0*(((double)(rand()))/RAND_MAX);
|
||||
|
@ -271,14 +271,24 @@ 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();
|
||||
vDirection.Normalize();
|
||||
|
||||
vTurbulence = TurbGain*Magnitude * vDirection;
|
||||
vTurbulenceGrad = TurbGain*MagnitudeAccel * vDirection;
|
||||
vTurbulence = TurbGain*AdjustedMagnitude * vDirection;
|
||||
vTurbulenceGrad = TurbGain*AdjustedMagnitudeAccel * vDirection;
|
||||
|
||||
vBodyTurbGrad = State->GetTl2b()*vTurbulenceGrad;
|
||||
vTurbPQR(eP) = vBodyTurbGrad(eY)/Aircraft->GetWingSpan();
|
||||
|
@ -293,6 +303,7 @@ void FGAtmosphere::Turbulence(void)
|
|||
vTurbPQR(eR) = vBodyTurbGrad(eX)/10.0;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue