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

HeadingPitchRoll.fromQuaternion clamps pitch asin #7654

Merged
merged 2 commits into from
Mar 15, 2019

Conversation

bkuster
Copy link
Contributor

@bkuster bkuster commented Mar 15, 2019

Issue

When evaluating a QuaternionSpline, it may sometimes happen, that the pitch value for looking straight down (-90°) is in fact larger then 1 by a rounding error of ~10^12. When using HeadingPitchRoll.fromQuaternion, this results in the .pitch value being NaN.

Fix

Instead of using Math.asin to determine the pitch, use CesiumMath.asinClamped.

@cesium-concierge
Copy link

Thanks for the pull request @bkuster!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@hpinkos
Copy link
Contributor

hpinkos commented Mar 15, 2019

Good catch, thanks @bkuster!

@hpinkos hpinkos merged commit fe60ac8 into CesiumGS:master Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants