Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Rotation flick animation / drift rotation is too difficult to trigger #1487

Closed
mb12 opened this issue May 8, 2015 · 8 comments
Closed

Rotation flick animation / drift rotation is too difficult to trigger #1487

mb12 opened this issue May 8, 2015 · 8 comments
Labels
bug iOS Mapbox Maps SDK for iOS

Comments

@mb12
Copy link

mb12 commented May 8, 2015

Its very difficult to trigger rotation drift animation in the current implementation. Its almost always detected as zoom. There is some discussion on this in #1338 as well.

@1ec5 1ec5 changed the title Rotation flick animation support (iOS). Rotation flick animation / drift rotation is too difficult to trigger May 8, 2015
@1ec5
Copy link
Contributor

1ec5 commented May 8, 2015

The rotation and pinch gesture recognizers are firing simultaneously, but drift rotation only kicks in if the rotation velocity is above 3 rad/s in either direction. This check is necessary to prevent non-flick rotation from causing drift, but we should try decreasing the constant a bit.

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS labels May 8, 2015
@1ec5 1ec5 added this to the iOS Beta 2 milestone May 8, 2015
@1ec5
Copy link
Contributor

1ec5 commented May 8, 2015

The other thing to consider is that it’s very rare for an iPhone user to perform a perfectly circular rotation gesture. Even when you intend to just rotate with your fingers, they almost always form an ellipse, which triggers the pinch gesture recognizer, because your hand is off to one side of the device.

@mb12
Copy link
Author

mb12 commented May 8, 2015

Thanks for the code pointers. 3 rad/sec is almost half a turn (172 degrees per sec).
I changed it to 0.78 (45 deg per sec) in my repo and rotation drift looks much better.

@mb12
Copy link
Author

mb12 commented May 8, 2015

Some other changes may also be needed for this. At times the map drifts in the direction opposite to what one would expect it to.

  • Do a clockwise rotation flick.
  • Before the first flick finishes, do another clockwise rotation flick. ==> At this point the drift direction suddenly changes.

@1ec5
Copy link
Contributor

1ec5 commented May 8, 2015

Note that even though 3 rad/sec may sound quite high, a flick only lasts for a small fraction of a second.

@mb12
Copy link
Author

mb12 commented May 8, 2015

For a rotation with 3 cm radius, 3 rads/sec translates to finger speed of 0.324 kph (0.2 mph).

@1ec5
Copy link
Contributor

1ec5 commented May 9, 2015

At this point the drift direction suddenly changes.

That sounds a lot like a lingering angle normalization bug that would be fixed by #1453. 0.78 seems to exacerbate the issue where a rotation is interpreted as an inward pinch – or maybe two-finger tap?

0.324 kph (0.2 mph)

Or 541.2 furlongs per fortnight. 😉 Actually, I just did some logging and found it quite easy to flick-rotate at ±4–5 rad/s without trying that hard, so maybe this constant isn’t the problem after all.

@jfirebaugh jfirebaugh modified the milestones: iOS Beta 3, iOS Beta 2 Jun 15, 2015
@incanus incanus modified the milestone: iOS Beta 3 Jul 7, 2015
@friedbunny
Copy link
Contributor

Stale.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

5 participants