1
0
Fork 0

Nasal/view.nas: fix for regression in handling of /sim/current-view/?-offset-m.

resetViewPos(): set /sim/current-view/?-offset-m to
/sim/view[]/config/?-offset-m, not zeros.

This requires corresponding change to flightgear to compensate for the extra
offset, and fixes things when aircraft implement custom views by writing to
/sim/current-view/?-offset-m.
This commit is contained in:
Julian Smith 2019-08-12 08:50:20 +01:00
parent ff503c1093
commit 81fc15d8e7

View file

@ -114,9 +114,9 @@ var resetFOV = func {
var resetViewPos = func {
var v = current.getNode("config");
setprop("/sim/current-view/x-offset-m", 0);
setprop("/sim/current-view/y-offset-m", 0);
setprop("/sim/current-view/z-offset-m", 0);
setprop("/sim/current-view/x-offset-m", v.getNode("x-offset-m", 1).getValue() or 0);
setprop("/sim/current-view/y-offset-m", v.getNode("y-offset-m", 1).getValue() or 0);
setprop("/sim/current-view/z-offset-m", v.getNode("z-offset-m", 1).getValue() or 0);
}
var resetViewDir = func {