Commit 6597e7a2 authored by Teemu Tamminen's avatar Teemu Tamminen

Added Smoother needle trails

parent 90897ccb
......@@ -29,6 +29,7 @@ Item {
target: main
from: 5
to: 15
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -36,6 +37,7 @@ Item {
target: main
from: 1500
to: 3800
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -52,6 +54,7 @@ Item {
target: main
from: 3800
to: 2000
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -59,6 +62,7 @@ Item {
target: main
from: 15
to: 10
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -69,6 +73,7 @@ Item {
target: main
from: 10
to: 35
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -76,6 +81,7 @@ Item {
target: main
from: 2000
to: 4200
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -92,6 +98,7 @@ Item {
target: main
from: 4200
to: 2400
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -99,6 +106,7 @@ Item {
target: main
from: 35
to: 30
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -109,6 +117,7 @@ Item {
target: main
from: 30
to: 65
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -116,6 +125,7 @@ Item {
target: main
from: 2400
to: 4600
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -132,6 +142,7 @@ Item {
target: main
from: 4600
to: 2400
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -139,6 +150,7 @@ Item {
target: main
from: 65
to: 60
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -149,6 +161,7 @@ Item {
target: main
from: 60
to: 95
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -156,6 +169,7 @@ Item {
target: main
from: 2400
to: 4800
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -172,6 +186,7 @@ Item {
target: main
from: 4800
to: 2400
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -179,6 +194,7 @@ Item {
target: main
from: 95
to: 90
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -189,6 +205,7 @@ Item {
target: main
from: 90
to: 130
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -196,6 +213,7 @@ Item {
target: main
from: 2400
to: 5200
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -212,6 +230,7 @@ Item {
target: main
from: 5200
to: 6200
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -219,6 +238,7 @@ Item {
target: main
from: 130
to: 120
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -229,6 +249,7 @@ Item {
target: main
from: 120
to: 60
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -236,6 +257,7 @@ Item {
target: main
from: 6200
to: 2300
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -252,6 +274,7 @@ Item {
target: main
from: 2300
to: 4000
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -259,6 +282,7 @@ Item {
target: main
from: 60
to: 50
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -269,6 +293,7 @@ Item {
target: main
from: 50
to: 20
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -276,6 +301,7 @@ Item {
target: main
from: 4000
to: 2300
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -292,6 +318,7 @@ Item {
target: main
from: 2300
to: 4000
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "speed"
......@@ -299,6 +326,7 @@ Item {
target: main
from: 20
to: 15
easing.type: Easing.InOutQuad;
}
}
ParallelAnimation {
......@@ -309,6 +337,7 @@ Item {
target: main
from: 15
to: 5
easing.type: Easing.InOutQuad;
}
PropertyAnimation {
property: "rpm"
......@@ -316,6 +345,7 @@ Item {
target: main
from: 4000
to: 1500
easing.type: Easing.InOutQuad;
}
}
}
......
......@@ -26,8 +26,8 @@ Window {
property real toptextoffset: 0.0
property bool rpmForward: true
property bool speedForward: true
property int rpmTrailOpacity: 100
property int speedTrailOpacity: 100
property real rpmTrailOpacity: 0
property real speedTrailOpacity: 0
property real roadSpeed: sim.roadSpeed * (sim.gear * 2)
// telltales
property bool leftblinker: false
......@@ -44,17 +44,26 @@ Window {
readonly property int secondsBetweenUpdates: 60 // Use a 1 minute average for the average FPS counter
onRpmrotationChanged: {
if (rpmrotation < previousrpmrotation)
if (rpmrotation < previousrpmrotation) {
rpmForward = false;
else
rpmTrailOpacity = 2 * (previousrpmrotation - rpmrotation);
}
else {
rpmForward = true;
rpmTrailOpacity = -2 * (previousrpmrotation - rpmrotation);
}
previousrpmrotation = rpmrotation;
}
onSpeedrotationChanged: {
if (speedrotation < previousspeedrotation)
if (speedrotation < previousspeedrotation) {
speedForward = false;
else
speedTrailOpacity = 2 * (previousspeedrotation - speedrotation);
}
else {
speedForward = true;
speedTrailOpacity = -2 * (previousspeedrotation - speedrotation);
}
previousspeedrotation = speedrotation;
}
onFrameSwapped: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment