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

Ensure offCenterFrustum's values are updated #11210

Merged
merged 3 commits into from
Apr 12, 2023
Merged

Ensure offCenterFrustum's values are updated #11210

merged 3 commits into from
Apr 12, 2023

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Apr 4, 2023

There was a bug where calling the following functions in immediate succession would result in an DeveloperError: normalized result is not a number.

camera.switchToOrthographicFrustum();
viewer.flyTo(tileset);

As illustrated in this forum post.

This was because the values of _offCenterFrustum were not up to date. To remedy this, I made a getter for external use which calls update, and updated the external references to the property, ensuring they are called once to avoid running the update function multiple times (though it shouldn't be too much overhead regardless, which is why other getters do the same).

I also re-ordered the specs such that they should now fail if offCeneterFrustum values are not up to date.

@ggetz ggetz requested a review from jjhembd April 4, 2023 15:00
@cesium-concierge
Copy link

Thanks for the pull request @ggetz!

  • ✔️ 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.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.

@ggetz
Copy link
Contributor Author

ggetz commented Apr 12, 2023

@jjhembd Conflicts here have been resolved and this is ready for review!

Copy link
Contributor

@jjhembd jjhembd left a comment

Choose a reason for hiding this comment

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

Thanks @ggetz! The changes look good, and it fixes the problem described in the forum post.

@jjhembd jjhembd merged commit 8c82397 into main Apr 12, 2023
@jjhembd jjhembd deleted the frustum-fix branch April 12, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Issue/PR closed
Development

Successfully merging this pull request may close these issues.

3 participants