- int i;
-
- // Compute the radius of the aircraft. That is the radius of a ball
- // where all gear units are in. At the moment it is at least 10ft ...
- double acrad = 10.0;
- int n_gears = GroundReactions->GetNumGearUnits();
- for (i=0; i<n_gears; ++i) {
- FGColumnVector3 bl = GroundReactions->GetGearUnit(i)->GetBodyLocation();
- double r = bl.Magnitude();
- if (acrad < r)
- acrad = r;
- }
-
- // Compute the potential movement of this aircraft and query for the
- // ground in this area.
- double groundCacheRadius = acrad + 2*dt*Propagate->GetUVW().Magnitude();
- double alt, slr, lat, lon;
- FGColumnVector3 cart = Auxiliary->GetLocationVRP();
- if ( needTrim && startup_trim->getBoolValue() ) {
- alt = fgic->GetAltitudeASLFtIC();
- slr = fgic->GetSeaLevelRadiusFtIC();
- lat = fgic->GetLatitudeDegIC() * SGD_DEGREES_TO_RADIANS;
- lon = fgic->GetLongitudeDegIC() * SGD_DEGREES_TO_RADIANS;
- cart = FGLocation(lon, lat, alt+slr);
- }
- double cart_pos[3] = { cart(1), cart(2), cart(3) };
- double t0 = fdmex->GetSimTime();
- bool cache_ok = prepare_ground_cache_ft( t0, t0 + dt, cart_pos,
- groundCacheRadius );
- if (!cache_ok) {
- SG_LOG(SG_FLIGHT, SG_WARN,
- "FGInterface is being called without scenery below the aircraft!");
-
- alt = fgic->GetAltitudeASLFtIC();
- SG_LOG(SG_FLIGHT, SG_WARN, "altitude = " << alt);
-
- slr = fgic->GetSeaLevelRadiusFtIC();
- SG_LOG(SG_FLIGHT, SG_WARN, "sea level radius = " << slr);
-
- lat = fgic->GetLatitudeDegIC() * SGD_DEGREES_TO_RADIANS;
- SG_LOG(SG_FLIGHT, SG_WARN, "latitude = " << lat);
-
- lon = fgic->GetLongitudeDegIC() * SGD_DEGREES_TO_RADIANS;
- SG_LOG(SG_FLIGHT, SG_WARN, "longitude = " << lon);
- //return;
- }