CVS: data/Nasal balloons.nas,NONE,1.1

Torsten Dreyer <[email protected]> Wed, 7 Apr 2010 09:16:44 -0500
Newsgroups gmane.games.flightgear.cvc
Message-ID <[email protected]>
Update of /var/cvs/FlightGear-0.9/data/Nasal
In directory baron.flightgear.org:/tmp/cvs-serv16978

Added Files:
	balloons.nas 
Log Message:
Initial import of the balloon scenario from gooneybird     

--- NEW FILE "balloons.nas" ---
# If the balloon scenario is loaded and enabled,
# place all balloons near the aircraft to get them loaded
#
_setlistener("/sim/signals/fdm-initialized", func {

  var balloonScenarioFound = 0;
  foreach( var scenario; props.globals.getNode("/sim/ai", 1 ).getChildren("scenario") ) {
    if( scenario.getValue() == "balloon_demo" )
      balloonScenarioFound = 1;
  }
  if( balloonScenarioFound != 0 ) {
    var position = geo.aircraft_position();
    var elevation = geo.elevation( position.lat(), position.lon() );
    position.set_alt( elevation != nil ? elevation : 0.0 );

    foreach( var tanker; props.globals.getNode("/ai/models",1).getChildren("tanker") ) {
      var callsign = tanker.getNode("callsign").getValue();
      if( callsign == nil ) continue;
      if( string.match(callsign,"ballon*") ) {
        tanker.getNode("position/latitude-deg",1).setDoubleValue( position.lat() );
        tanker.getNode("position/longitude-deg",1).setDoubleValue( position.lon() );
        tanker.getNode("position/altitude-ft", 1 ).setDoubleValue( position.alt() );
      }
    }
  }
  delete(globals, "balloons");
});




------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev