]> git.mxchange.org Git - flightgear.git/commit
add geodinfo(<lat>, <lon>) function that returns an array [<elev>, <matdata>]
authormfranz <mfranz>
Sat, 23 Jun 2007 15:25:41 +0000 (15:25 +0000)
committermfranz <mfranz>
Sat, 23 Jun 2007 15:25:41 +0000 (15:25 +0000)
commit3461466c81a047071bb139517d319ad87ac6af26
treecfd2712f57167fd4ad82f8a677a0cc18fc6abd1f
parentee231459361c4e73eb8e8d7bf6747b6e8235e12e
add geodinfo(<lat>, <lon>) function that returns an array [<elev>, <matdata>]
or nil if no terrain intersection could be made (tile not loaded yet).
<matdata> is a hash with information about the surface material, or nil
if no material is assigned (shouldn't really happen, but one never knows).

Example:

  var ac = geo.aircraft_position();
  var data = geoddata(ac.lat(), ac.lon());
  debug.dump(data);

  # which outputs
  [ 294.5862574369132, { light_coverage : 0, bumpiness : 0, load_resistance : 1e+30,
  solid : 1, names : [ "pc_taxiway", "dirt_rwytaxiway" ], friction_factor : 1,
  rolling_friction : 0.02 } ]

With this information it can be determined how far an object would sink in,
if the coordinate is on a runway, etc.

  foreach (var n; data[1].names)
      if (string.match(n, "p[ac]_*"))
          im_on_a_runway();
src/Scripting/NasalSys.cxx