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

Update Viewer on preUpdate instead of clock tick #7069

Merged
merged 4 commits into from
Sep 26, 2018
Merged

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Sep 26, 2018

This changes the viewer to be updated on preUpdate rather than clock tick from this idea in #7204.

This allows entity changes to be reflected in the pick pass.

I'm a little hesitant about making a core change like this but it seems mostly safe as clock.tick() and scene.render() are called right after another in CesiumWidget.

this branch vs. master

@cesium-concierge
Copy link

Thanks for the pull request @lilleyse!

  • ✔️ 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.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@lilleyse lilleyse mentioned this pull request Sep 26, 2018
8 tasks
@hpinkos
Copy link
Contributor

hpinkos commented Sep 26, 2018

This seems okay with me. I'll let @mramato make the call on this though

@mramato
Copy link
Contributor

mramato commented Sep 26, 2018

Looks like you have some test failures.

I've actually wanted to explore making this change ever since we added the pre/post render events. I'm honestly not that worried about it (because as you said, the tick/preRender always get called back to back in our own internal render loop).

That being said, we should still hammer on this before merging, so I'll take a look at it now.

Viewer.prototype._onTick = function(clock) {
var time = clock.currentTime;

Viewer.prototype._onUpdate = function(scene, time) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name this _onPreUpdate just so it's more obvious.

@lilleyse
Copy link
Contributor Author

Renamed the function and fixed the tests (had the commit locally but forgot to push - it shows up above the comments).

@mramato
Copy link
Contributor

mramato commented Sep 26, 2018

Thanks @lilleyse. The build failed for seemingly unrelated reasons that looks like they might be related to external urls.

@mramato mramato merged commit 19b6914 into master Sep 26, 2018
@mramato mramato deleted the update-entities branch September 26, 2018 14:56
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.

4 participants