[drape] Add FollowAndRotateRoute mode

This adds a new mode to rotate the camera towards the route while driving.
This is done by looking ahead X number of seconds along the current route,
up to the next turn, and calculating the angle between the current position
and then.

Squashed commits:

[drape] Add bearing calculation via route lookahead while navigating
[drape] Extract NavigationContext from OnLocationUpdate params
[drape] Increase rotation animation duration during navigation
[drape] Seperate route and compass rotation into two modes
[drape] Reduce route lookahead maximum to 25 seconds
[drape] Fix case where rotation was incorrectly considered invalid
[drape] Make FollowAndRotateRoute mode only available during driving navigation
[drape] Rewrite FollowedPolyline::GetLookaheadPoint
[drape] Cleanup

Signed-off-by: Leonardo Bishop <me@leonardobishop.net>
This commit is contained in:
Leonardo Bishop
2025-12-05 16:47:59 +00:00
committed by Konstantin Pastbin
parent 0d01076c0f
commit 515cf98cef
13 changed files with 243 additions and 108 deletions

View File

@@ -308,7 +308,8 @@ string ToString<location::EMyPositionMode>(location::EMyPositionMode const & v)
case location::NotFollow: return "NotFollow";
case location::NotFollowNoPosition: return "NotFollowNoPosition";
case location::Follow: return "Follow";
case location::FollowAndRotate: return "FollowAndRotate";
case location::FollowAndRotateCompass: return "FollowAndRotateCompass";
case location::FollowAndRotateRoute: return "FollowAndRotateRoute";
default: return "Pending";
}
}
@@ -324,8 +325,10 @@ bool FromString<location::EMyPositionMode>(string const & s, location::EMyPositi
v = location::NotFollowNoPosition;
else if (s == "Follow")
v = location::Follow;
else if (s == "FollowAndRotate")
v = location::FollowAndRotate;
else if (s == "FollowAndRotateCompass")
v = location::FollowAndRotateCompass;
else if (s == "FollowAndRotateRoute")
v = location::FollowAndRotateRoute;
else
return false;