Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[viewport] use shortest path for viewport bearing transition MAPSAND-188 #1541

Merged
merged 2 commits into from Aug 10, 2022

Conversation

ank27
Copy link
Contributor

@ank27 ank27 commented Jul 27, 2022

Summary of changes

Default viewport implementation doesn't use the shortest bearing transition when animating, this pr fixes the bug calculating the shortest path for bearing rotation.

Before After
bearing_before.mp4
bearing_transition_after.mp4

User impact (optional)

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Optimize code for java consumption (@JvmOverloads, @file:JvmName, etc).
  • Add example if relevant.
  • Document any changes to public APIs.
  • Run make update-api to update generated api files, if there's public API changes, otherwise the verify-api-* CI steps might fail.
  • Update CHANGELOG.md or use the label 'skip changelog', otherwise check changelog CI step will fail.
  • If this PR is a v10.[version] release branch fix / enhancement, merge it to main firstly and then port to v10.[version] release branch.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

PRs must be submitted under the terms of our Contributor License Agreement CLA.

@ank27 ank27 added the bug 🪲 Something isn't working label Jul 27, 2022
@ank27 ank27 requested a review from a team as a code owner July 27, 2022 10:01
@ank27 ank27 self-assigned this Jul 27, 2022
@ank27 ank27 changed the title [viewport] use shortest path for viewport bearing transition [viewport] use shortest path for viewport bearing transition MAPSAND-188 Jul 27, 2022
Comment on lines +197 to +202
targetCamera.bearing?.let { targetBearing ->
val targets = MathUtils.prepareOptimalBearingPath(
doubleArrayOf(startCamera.bearing, targetBearing)
).toTypedArray()
cameraAnimator.setObjectValues(*targets)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably should keep the bearing move direction to be consistent when the initial bearing animator is created.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant we should keep the start position the same and only update the target position?

@ank27 ank27 force-pushed the ak-fix-viewport-bearing-transition branch from 3eea501 to 6ddf444 Compare August 1, 2022 12:31
@ank27 ank27 merged commit 2e843cd into main Aug 10, 2022
@ank27 ank27 deleted the ak-fix-viewport-bearing-transition branch August 10, 2022 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants