From 5bb90ec228d7c11081b56be70ce4dae6eb0380b5 Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Fri, 9 Oct 2015 17:32:19 +0300 Subject: [PATCH] Additions to ufo: sideways movement and virtual doors for jetway testing by forum user pommesschranke --- Aircraft/ufo/ufo-set.xml | 68 ++++++++++++++++++++++++++++++++++++++-- Aircraft/ufo/ufo.nas | 20 +++++++++++- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/Aircraft/ufo/ufo-set.xml b/Aircraft/ufo/ufo-set.xml index 616a18aaf..1b02c2ef6 100644 --- a/Aircraft/ufo/ufo-set.xml +++ b/Aircraft/ufo/ufo-set.xml @@ -10,7 +10,9 @@ Avec l'UFO (OVNI) vous pouvez placer des objets 3D dans les scènes de FlightGear scenery - + + Mit dem UFO kann man 3D Objekte in der FlightGear Szenerie platzieren + fictional @@ -31,6 +33,25 @@ Aircraft/ufo/Models/ufo.xml false + + -5.0 + -10.0 + 0 + 3 + + + 0.0 + -10.0 + 0 + 3 + + + 5.0 + -10.0 + 0 + 3 + + @@ -44,6 +65,7 @@ true + 118.0 false @@ -63,7 +85,7 @@ true 0 0.5f - 55.0 + 118.0 0 0 0 @@ -100,6 +122,14 @@ End Hover down + + , + Hover left + + + . + Hover right + mouse click add model to scenery @@ -470,6 +500,40 @@ + + + + , + skew left + true + + nasal + + + + + nasal + + + + + + . + skew right + true + + nasal + + + + + nasal + + + + + + End diff --git a/Aircraft/ufo/ufo.nas b/Aircraft/ufo/ufo.nas index 619d5b59f..4a8cf6057 100644 --- a/Aircraft/ufo/ufo.nas +++ b/Aircraft/ufo/ufo.nas @@ -759,10 +759,28 @@ var up = func(dir) { return vert_factor = 1; var alt = "position/altitude-ft"; setprop(alt, getprop(alt) + 0.15 * vert_factor * dir); - vert_factor += 0.25; + vert_factor += 0.50; } +var hor_factor = 1; +var leftright = func(dir) { + if (!dir) + return hor_factor = 1; + var lat = getprop("position/latitude-deg"); + var lon = getprop("position/longitude-deg"); + var alt = getprop("position/altitude-ft"); + var heading = getprop("orientation/heading-deg"); + var ep = geo.Coord.new(); + ep.set_latlon(lat, lon,alt); + ep.apply_course_distance(heading+90, 0.15 * hor_factor * dir); + setprop("/position/latitude-deg", ep.lat()); + setprop("/position/longitude-deg", ep.lon()); + hor_factor += 0.50; +} + + + var print_data = func { var rule = "\n------------------------------------------------------------------\n"; print("\n\n");