Indicate these models want to use their own terrein handling code, until they switch...
[fg:toms-fgdata.git] / Aircraft / SR71-BlackBird / Systems / terrain.nas
1
2 # Do terrain modelling ourselves.
3 setprop("sim/fdm/surface/override-level", 1);
4
5 terrain_survol = func {
6
7 var lat = getprop("/position/latitude-deg");
8 var lon = getprop("/position/longitude-deg");
9 var info = geodinfo(lat, lon);
10
11  if (info != nil) {
12     if (info[0] != nil){
13        setprop("/environment/terrain-hight",info[0]);
14     }
15     if (info[1] != nil){
16       if (info[1].solid !=nil)
17        setprop("/environment/terrain-solid",info[1].solid);
18       if (info[1].light_coverage !=nil)
19        setprop("/environment/terrain-light-coverage",info[1].light_coverage);
20       if (info[1].load_resistance !=nil)
21        setprop("/environment/terrain-load-resistance",info[1].load_resistance);
22       if (info[1].friction_factor !=nil)
23        setprop("/environment/terrain-friction-factor",info[1].friction_factor);
24       if (info[1].bumpiness !=nil)
25        setprop("/environment/terrain-bumpiness",info[1].bumpiness);
26       if (info[1].rolling_friction !=nil)
27        setprop("/environment/terrain-rolling-friction",info[1].rolling_friction);
28       if (info[1].names !=nil)
29        setprop("/environment/terrain-names",info[1].names[0]);
30       }
31
32               #debug.dump(geodinfo(lat, lon));
33
34         
35   }else {
36     setprop("/environment/terrain-hight",0);
37     setprop("/environment/terrain-solid",1);
38     setprop("/environment/terrain-light-coverage",1);
39     setprop("/environment/terrain-load-resistance",1e+30);
40     setprop("/environment/terrain-friction-factor",1);
41     setprop("/environment/terrain-bumpiness",0);
42     setprop("/environment/terrain-rolling-friction",0.02);
43     }
44
45 settimer (terrain_survol, 0.1);
46 }
47
48
49 terrain_survol();
50