More realisting compass easing
This commit is contained in:
parent
03a15d43c9
commit
c6568ace49
2 changed files with 19 additions and 17 deletions
|
@ -288,19 +288,21 @@ canvas.NavDisplay.update_sub = func(){
|
||||||
userHdgTrkTru = userTrkTru;
|
userHdgTrkTru = userTrkTru;
|
||||||
me.symbols.hdgTrk.setText("TRK");
|
me.symbols.hdgTrk.setText("TRK");
|
||||||
} else {
|
} else {
|
||||||
var dist = int(userHdg - me.lastCompassRot);
|
var dist = userHdg - me.lastCompassRot;
|
||||||
if (dist>180) dist = dist - 360;
|
if (dist != 0) {
|
||||||
elsif (dist<-180) dist = 360 + dist;
|
if (dist>180) dist = dist - 360;
|
||||||
if (dist>0) {
|
elsif (dist<-180) dist = 360 + dist;
|
||||||
dist = dist * 0.3;
|
if (dist>0) {
|
||||||
if (dist>20) dist = 20;
|
dist = dist * 0.3;
|
||||||
me.lastCompassRot = (dist<1) ? userHdg : me.lastCompassRot+dist;
|
if (dist>10) dist = 10;
|
||||||
}
|
me.lastCompassRot = (dist<0.2) ? userHdg : math.mod(me.lastCompassRot+dist,360);
|
||||||
elsif (dist<0) {
|
}
|
||||||
dist = dist * 0.3;
|
elsif (dist<0) {
|
||||||
if (dist<-20) dist = -20;
|
dist = dist * 0.3;
|
||||||
me.lastCompassRot = (dist>-1) ? userHdg : me.lastCompassRot+dist;
|
if (dist<-10) dist = -10;
|
||||||
}
|
me.lastCompassRot = (dist>-0.2) ? userHdg : math.mod(me.lastCompassRot+dist,360);
|
||||||
|
}
|
||||||
|
}
|
||||||
userHdgTrk = me.lastCompassRot;
|
userHdgTrk = me.lastCompassRot;
|
||||||
me.userHdgTrk = me.lastCompassRot;
|
me.userHdgTrk = me.lastCompassRot;
|
||||||
userHdgTrkTru = userHdgTru;
|
userHdgTrkTru = userHdgTru;
|
||||||
|
|
|
@ -1320,13 +1320,13 @@
|
||||||
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text><text
|
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text><text
|
||||||
inkscape:label="#text7243"
|
inkscape:label="#text7243"
|
||||||
id="hdgBug2ValR"
|
id="hdgBug2ValR"
|
||||||
y="-413.09033"
|
y="-416.36694"
|
||||||
x="875.60876"
|
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"
|
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"
|
xml:space="preserve"
|
||||||
transform="rotate(35)"><tspan
|
transform="rotate(35)"><tspan
|
||||||
y="-413.09033"
|
y="-416.36694"
|
||||||
x="875.60876"
|
x="873.31445"
|
||||||
id="tspan748"
|
id="tspan748"
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text></g><g
|
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 |
Loading…
Add table
Reference in a new issue