1
0
Fork 0

More realisting compass easing

This commit is contained in:
Inuyaksa 2021-01-31 11:23:33 +01:00
parent 03a15d43c9
commit c6568ace49
2 changed files with 19 additions and 17 deletions

View file

@ -288,19 +288,21 @@ canvas.NavDisplay.update_sub = func(){
userHdgTrkTru = userTrkTru;
me.symbols.hdgTrk.setText("TRK");
} else {
var dist = int(userHdg - me.lastCompassRot);
if (dist>180) dist = dist - 360;
elsif (dist<-180) dist = 360 + dist;
if (dist>0) {
dist = dist * 0.3;
if (dist>20) dist = 20;
me.lastCompassRot = (dist<1) ? userHdg : me.lastCompassRot+dist;
}
elsif (dist<0) {
dist = dist * 0.3;
if (dist<-20) dist = -20;
me.lastCompassRot = (dist>-1) ? userHdg : me.lastCompassRot+dist;
}
var dist = userHdg - me.lastCompassRot;
if (dist != 0) {
if (dist>180) dist = dist - 360;
elsif (dist<-180) dist = 360 + dist;
if (dist>0) {
dist = dist * 0.3;
if (dist>10) dist = 10;
me.lastCompassRot = (dist<0.2) ? userHdg : math.mod(me.lastCompassRot+dist,360);
}
elsif (dist<0) {
dist = dist * 0.3;
if (dist<-10) dist = -10;
me.lastCompassRot = (dist>-0.2) ? userHdg : math.mod(me.lastCompassRot+dist,360);
}
}
userHdgTrk = me.lastCompassRot;
me.userHdgTrk = me.lastCompassRot;
userHdgTrkTru = userHdgTru;

View file

@ -1320,13 +1320,13 @@
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text><text
inkscape:label="#text7243"
id="hdgBug2ValR"
y="-413.09033"
x="875.60876"
y="-416.36694"
x="873.31445"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
xml:space="preserve"
transform="rotate(35)"><tspan
y="-413.09033"
x="875.60876"
y="-416.36694"
x="873.31445"
id="tspan748"
sodipodi:role="line"
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text></g><g

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB