1
0
Fork 0
flightgear/src/Scripting
mfranz 3461466c81 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();
2007-06-23 15:25:41 +00:00
..
.cvsignore Added simple proof-of-concept support for running PSL scripts from 2003-01-11 16:30:32 +00:00
Makefile.am screenPrint() is obsolete. Use screen.log.write() for the same purpose, 2006-02-13 19:46:03 +00:00
nasal-props.cxx let foo.getAttribute("listeners") return the number of listeners attached 2007-05-07 14:23:56 +00:00
NasalSys.cxx add geodinfo(<lat>, <lon>) function that returns an array [<elev>, <matdata>] 2007-06-23 15:25:41 +00:00
NasalSys.hxx add error messages for invalid args to settimer() 2007-05-12 18:15:45 +00:00