You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
User location tracking for is functional #756 but rough compared to MapKit’s implementation. In MapKit, the user dot crawls continuously and the map pans just as smoothly. Our implementation jerks forward every time the GPS location changes. Since the panning motion is animated, the map always trails the user dot. Instead, perhaps it could lead the user dot, by overshooting it based on its n previous coordinates.
Perfect opportunity for implementation of techniques from video games here. Valve has published some great work on this. I've previously implemented entity interpolation in JavaScript (mostly transliterating from Valve's C++ examples) and would be happy to help with this if needed.
Optimistically assume that an entity will continue traveling on it's current trajectory and velocity, retroactively correcting as necessary.
This works well for bullets, does not work well for less predictable actions like player movement (can cause "lag skipping" all over the screen in high latency conditions).
"entity interpolation"
Interpolate an object, animating it from a less recently known location to a more recently known location.
This can introduce slight player latency, but is configurable for smoothness versus accuracy and generally results in smoother, more predictable animation.
MapKit apparently uses entity interpolation, or at least a crude version. In the iOS Simulator, switch from City Run to City Bicycle Ride (for instance) and note how the user dot animates back to the Infinite Loop 1 entrance without skipping any steps. In dfd563a, I used UIView block-based animation to accomplish pretty much the same thing for the non-tracking case.
In Map kit, the user location view is fixed on the screen and the map moves under it, This is not really related to any entity interpolation of the current users location.
@muZZkat, the behavior you describe would still require entry interpolation or dead reckoning, except only to pan the map smoothly, rather than move the user dot (thus causing the map to pan), as #1582 does.
Activity
1ec5 commentedon Apr 3, 2015
Looks like
-[CLLocation speed]and-[CLLocation course]will be of use here.mikemorris commentedon Apr 3, 2015
Perfect opportunity for implementation of techniques from video games here. Valve has published some great work on this. I've previously implemented entity interpolation in JavaScript (mostly transliterating from Valve's C++ examples) and would be happy to help with this if needed.
mikemorris commentedon Apr 3, 2015
There are two different ways to implement this:
incanus commentedon Apr 10, 2015
We can do this pretty easily as the user dot is a native iOS view. We do an atomic position update that could just use implicit layer animation.
First attempt at animating user dot
1ec5 commentedon May 18, 2015
MapKit apparently uses entity interpolation, or at least a crude version. In the iOS Simulator, switch from City Run to City Bicycle Ride (for instance) and note how the user dot animates back to the Infinite Loop 1 entrance without skipping any steps. In dfd563a, I used UIView block-based animation to accomplish pretty much the same thing for the non-tracking case.
incanus commentedon Aug 28, 2015
Using
map.userTrackingMode = .FollowWithCourseis much more stable here and applicable to navigation-type apps.1ec5 commentedon Aug 28, 2015
No,
.FollowWithCoursewill have the same behavior described here.picciano commentedon Sep 9, 2015
Any thoughts on scheduling this into a milestone?
muZZkat commentedon Oct 16, 2015
In Map kit, the user location view is fixed on the screen and the map moves under it, This is not really related to any entity interpolation of the current users location.
1ec5 commentedon Oct 16, 2015
@muZZkat, the behavior you describe would still require entry interpolation or dead reckoning, except only to pan the map smoothly, rather than move the user dot (thus causing the map to pan), as #1582 does.
7 remaining items
[ios] First attempt at animating user dot
[ios] Affix user dot on screen in user tracking mode
[ios] First attempt at animating user dot
[ios] Affix user dot on screen in user tracking mode
[ios] Affix user dot on screen in user tracking mode
1ec5 commentedon Jan 20, 2016
Next steps are in #1582, which is about smoothly moving the user dot outside of user tracking mode.
[ios] First attempt at animating user dot