* Frederic Bouvier -- Tuesday 19 May 2009:
> Maybe we could distinguish terrain and models in the traversal mask ?
> For the moment, every solid models has the terrain bit. Then geo.elevation()
> could accept a parameter that tells if it search terrain or solid objects.

geo.elevation() is just a convenience wrapper for geodinfo(). And while
that can't be limited to search only for terrain *or* objects, it is already
possible to determine whether a returned elevation was that of an object
or of terrain. Just add this code somewhere:

  var loop = func {
      var ac = geo.aircraft_position();
      debug.dump(geodinfo(ac.lat(), ac.lon(), ac.alt()));
      settimer(loop, 1);
  }
  loop();

... then fly along with the UFO. You'll get one set of geod(etic)info(rmation)
at the UFO's coordinates per second. There are three different kinds of 
responses:

  1: nil                                                                        
                                                    
  2: [0.5990206304960102, { load_resistance: 1e+30, friction_factor: 1, \
           names: ['pa_dspl_thresh'], solid: 1, bumpiness: 0, rolling_friction: 
0.02, \
           light_coverage: 0 }]
  3: [10.13547897298338, nil]

The first is with no terrain or object below, the second is with terain below,
and the third is with an object below (no terrain data!). So you can also easily
see if you are under something: just test from your current altitude and from
100000 m altitude. If the former returns terrain and the latter an object, then
you are in/under something.

m.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to