mirror of
https://github.com/l0k1/oprf_assets.git
synced 2024-11-01 07:41:15 +08:00
Merge branch 'master' of https://github.com/l0k1/oprf_assets
This commit is contained in:
commit
21273aa4df
@ -21,7 +21,7 @@
|
||||
var frequency = 20.0;
|
||||
|
||||
# Change in heading per second at full rudder deflection
|
||||
var heading_ps = 0.1;
|
||||
var heading_ps = 5.0;
|
||||
|
||||
time_last = 0;
|
||||
sim_speed = 1;
|
||||
@ -50,14 +50,17 @@ var PositionUpdater = func () {
|
||||
if (dt == 0) return;
|
||||
|
||||
time_last = time_now;
|
||||
|
||||
var heading = getprop("/orientation/heading-deg");
|
||||
var speed = getprop("/velocities/groundspeed-kt");
|
||||
var rudder = getprop("/surface-positions/rudder-pos-norm");
|
||||
|
||||
var aground_pos = geo.Coord.new().set_latlon(position.lat(),position.lon());
|
||||
aground_pos.apply_course_distance(heading,25);
|
||||
var aground = geodinfo(aground_pos.lat(), aground_pos.lon())[1].solid;
|
||||
|
||||
var aground = geodinfo(aground_pos.lat(), aground_pos.lon());
|
||||
if (aground != nil) {
|
||||
if (aground[1] != nil){
|
||||
aground = aground[1].solid;
|
||||
if ( aground == 0 ) {
|
||||
aground_pos.apply_course_distance(heading,-50);
|
||||
aground = geodinfo(aground_pos.lat(), aground_pos.lon())[1].solid;
|
||||
@ -65,11 +68,10 @@ var PositionUpdater = func () {
|
||||
if ( aground == 1 ) {
|
||||
setprop("/carrier/aground",1);
|
||||
setprop("/carrier/sunk",1);
|
||||
}
|
||||
|
||||
if ( aground == 1 ) {
|
||||
speed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#print(speed);
|
||||
var distance = speed * globals.KT2MPS * dt;
|
||||
position.apply_course_distance(heading, distance);
|
||||
|
Loading…
Reference in New Issue
Block a user