make constants D2R, R2D, M2FT, FT2M global
This commit is contained in:
parent
090679e524
commit
dcb1321923
3 changed files with 10 additions and 9 deletions
|
@ -3,13 +3,6 @@
|
|||
|
||||
|
||||
|
||||
# constants
|
||||
# ==============================================================================
|
||||
var D2R = math.pi / 180;
|
||||
var R2D = 180 / math.pi;
|
||||
|
||||
|
||||
|
||||
# helper functions
|
||||
# ==============================================================================
|
||||
|
||||
|
|
|
@ -139,3 +139,11 @@ settimer(func {
|
|||
io.load_nasal(path ~ "/" ~ file, substr(file, 0, size(file) - 4));
|
||||
}, 0);
|
||||
|
||||
|
||||
##
|
||||
# Constants.
|
||||
#
|
||||
var D2R = math.pi / 180; # degree to radian
|
||||
var R2D = 180 / math.pi; # radian to degree
|
||||
var FT2M = 0.3048; # feet to meter
|
||||
var M2FT = 3.28083989501312335958; # meter to feet
|
||||
|
|
|
@ -285,7 +285,7 @@ var fly_by_view_handler = {
|
|||
|
||||
# apply random deviation
|
||||
var radius = me.chase * (0.5 * rand() + 0.7);
|
||||
var agl = getprop("/position/altitude-agl-ft") * geo.FT2M;
|
||||
var agl = getprop("/position/altitude-agl-ft") * FT2M;
|
||||
if (agl > me.chase)
|
||||
var angle = rand() * 2 * math.pi;
|
||||
else
|
||||
|
@ -313,7 +313,7 @@ var fly_by_view_handler = {
|
|||
# set new view point
|
||||
me.latN.setValue(lat);
|
||||
me.lonN.setValue(lon);
|
||||
me.altN.setValue(alt * geo.M2FT);
|
||||
me.altN.setValue(alt * M2FT);
|
||||
return 7.3;
|
||||
},
|
||||
update : func {
|
||||
|
|
Loading…
Reference in a new issue