diff --git a/src/lib/marble/RouteSimulationPositionProviderPlugin.cpp b/src/lib/marble/RouteSimulationPositionProviderPlugin.cpp --- a/src/lib/marble/RouteSimulationPositionProviderPlugin.cpp +++ b/src/lib/marble/RouteSimulationPositionProviderPlugin.cpp @@ -159,26 +159,26 @@ if ( m_currentPosition.isValid() ) { //speed calculations //Max speed is set on points (m_lineStringInterpolated) based on formula. (max speed before points is calculated so the acceleration won't be exceeded) - const double acceleration = 1.5; - const double lookForwardDistance = 1000; - double checkedDistance = distanceSphere( m_currentPosition, m_lineStringInterpolated.at(m_currentIndex) )* m_marbleModel->planetRadius(); - const double maxSpeed = 25; - const double minSpeed = 2; - double newSpeed = qMin((m_speed + acceleration*time), maxSpeed); + const qreal acceleration = 1.5; + const qreal lookForwardDistance = 1000; + qreal checkedDistance = distanceSphere( m_currentPosition, m_lineStringInterpolated.at(m_currentIndex) )* m_marbleModel->planetRadius(); + const qreal maxSpeed = 25; + const qreal minSpeed = 2; + qreal newSpeed = qMin((m_speed + acceleration*time), maxSpeed); for (int i=qMax(1,m_currentIndex); i180) { differenceHeading = 360 - differenceHeading; } angleSum +=differenceHeading; - double maxSpeedAtTurn = qMax(((1 - (angleSum/60.0/curveLength*10.0))*maxSpeed), minSpeed);//speed limit at turn + qreal maxSpeedAtTurn = qMax((1 - (static_cast(angleSum/60.0/curveLength*10.0))*maxSpeed), minSpeed);//speed limit at turn if( checkedDistance<25 && maxSpeedAtTurnplanetRadius(); @@ -201,7 +201,7 @@ //Assume the car's moving at m_speed m/s. The distance moved will be speed*time which is equal to the speed of the car if time is equal to one. //If the function isn't called once exactly after a second, multiplying by the time will compensate for the error and maintain the speed. - double fraction = m_speed*time/(distanceSphere( m_currentPosition, newPosition )* m_marbleModel->planetRadius()); + qreal fraction = m_speed*time/(distanceSphere( m_currentPosition, newPosition )* m_marbleModel->planetRadius()); //Interpolate and find the next point to move to if needed. if(fraction>0 && fraction <1){