Integrate code posted by Jon Berndt, so that only the z-direction
turbulence is diminished near the ground.
This commit is contained in:
parent
0a6d2b7559
commit
2412c3a334
1 changed files with 9 additions and 12 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue