1
0
Fork 0

Additions to ufo: sideways movement and virtual doors for jetway testing by forum user pommesschranke

This commit is contained in:
Thorsten Renk 2015-10-09 17:32:19 +03:00
parent 57b48abe58
commit 5bb90ec228
2 changed files with 85 additions and 3 deletions

View file

@ -10,7 +10,9 @@
<fr>
<long-description>Avec l'UFO (OVNI) vous pouvez placer des objets 3D dans les scènes de FlightGear scenery</long-description>
</fr>
<de>
<long-description>Mit dem UFO kann man 3D Objekte in der FlightGear Szenerie platzieren</long-description>
</de>
<tags>
<tag>fictional</tag>
@ -31,6 +33,25 @@
<model>
<path>Aircraft/ufo/Models/ufo.xml</path>
<always-show-in-MP type="bool">false</always-show-in-MP>
<door>
<position-x-m type="float">-5.0</position-x-m>
<position-y-m type="float">-10.0</position-y-m>
<position-z-m type="float">0</position-z-m>
<jetway-hood-deg type="float">3</jetway-hood-deg>
</door>
<door n="1">
<position-x-m type="float">0.0</position-x-m>
<position-y-m type="float">-10.0</position-y-m>
<position-z-m type="float">0</position-z-m>
<jetway-hood-deg type="float">3</jetway-hood-deg>
</door>
<door n="2">
<position-x-m type="float">5.0</position-x-m>
<position-y-m type="float">-10.0</position-y-m>
<position-z-m type="float">0</position-z-m>
<jetway-hood-deg type="float">3</jetway-hood-deg>
</door>
</model>
<instrumentation>
@ -44,6 +65,7 @@
<view n="0">
<internal type="bool">true</internal>
<config>
<default-field-of-view-deg type="double">118.0</default-field-of-view-deg>
<limits>
<enabled type="bool">false</enabled>
</limits>
@ -63,7 +85,7 @@
<from-model type="bool">true</from-model>
<from-model-idx type="int">0</from-model-idx>
<ground-level-nearplane-m type="double">0.5f</ground-level-nearplane-m>
<default-field-of-view-deg type="double">55.0</default-field-of-view-deg>
<default-field-of-view-deg type="double">118.0</default-field-of-view-deg>
<default-pitch-deg type="double">0</default-pitch-deg>
<default-heading-deg type="double">0</default-heading-deg>
<front-direction-deg type="double">0</front-direction-deg>
@ -100,6 +122,14 @@
<name>End</name>
<desc>Hover down</desc>
</key>
<key>
<name>,</name>
<desc>Hover left</desc>
</key>
<key>
<name>.</name>
<desc>Hover right</desc>
</key>
<key>
<name>mouse click</name>
<desc>add model to scenery</desc>
@ -470,6 +500,40 @@
</binding>
</mod-up>
</key>
<key n="44">
<name>,</name>
<desc>skew left</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>nasal</command>
<script>ufo.leftright(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>ufo.leftright(0)</script>
</binding>
</mod-up>
</key>
<key n="46">
<name>.</name>
<desc>skew right</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>nasal</command>
<script>ufo.leftright(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>ufo.leftright(0)</script>
</binding>
</mod-up>
</key>
<key n="363">
<name>End</name>

View file

@ -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");