-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Prevent camera from going underground during mouse navigation #8504
Conversation
Thanks for the pull request @lilleyse!
Reviewers, don't forget to make sure that:
|
1c077ac
to
587ce95
Compare
This sounds like a good fix to me. I retested the initial issue (#4075) and it still works as of this PR. |
There seem to still be some cases where you can go underground: To recreate the above, I modified http://localhost:8080/Apps/Sandcastle/index.html?src=KML.html&label=DataSources and enabled clampToGround for the facilities KML and turned on terrain. Assuming this isn't a trivial fix or is an unrelated issue, I'm okay with this going in as-is and having another issue written up, just wanted to bring it to your attention. |
It's actually even easier to reproduce with just the stock example: http://localhost:8080/Apps/Sandcastle/index.html?src=GeoJSON%20simplestyle.html&label=DataSources using the ellipsoid provider |
e203392
to
648b10a
Compare
@mramato I pushed a commit that should fix that. I actually had this fix on underground-camera but didn't think to move it over here. The problem was The GeoJSON demo now works much smoother. Any remaining flicker problems are due to log-depth. |
Looks awesome @lilleyse this is a huge improvement. I couldn't get the camera to go permanently underground at all and only saw very rare flashes as tiles were loading in high-detail terrain areas. @IanLilleyT please review and merge if you're satisfied. @lilleyse any reason this can't make Monday's release? Seems like a huge win and a relatively minor change, but if you're not comfortable with putting it in just yet, I'm happy to have us hold off until Feb 1st. |
I'd prefer to wait for February in case this change has some unintended side affect that we're not aware of yet. I'm going to be working in the camera system a lot in January so there will be plenty of opportunity to catch any mistakes. |
This looks good. It fixes both the linked issues. Going to merge after the January release. Future work: Adjusting the height only when the camera moves is not always enough. For example: If you pivot the camera and release before all the high detail tiles are loaded, the camera can get stuck underground and does not recover until you move the camera again. Or if, in the future, terrain is dynamic and goes above the camera, the camera won't snap upwards. Not sure what the best fix is. It has to play nicely with |
…rground This was fixed in CesiumGS/cesium#8504
…rground This was fixed in CesiumGS/cesium#8504
…rground This was fixed in CesiumGS/cesium#8504
Fixes #5837
Fixes #5999 (I think)
Since #4105 the camera has been allowed to underground if globe tiles are loading in order to prevent unwanted shifts during camera flights or
setView
calls. However this leads to poor user experience when manually navigating around terrain and accidentally slipping underground, especially on slower internet connections where it happens much more frequently.This PR undoes #4105 and moves the onus to adjust height back to
ScreenSpaceCameraController
, but only if the camera has moved during the controller's update. CameraflyTo
andsetView
are not affected because terrain adjustment only happens when the user interacts with the camera which cannot occur during these two operations. This behavior can be confirmed in this sandcastle.This method also removes some pretty bad coupling between
Camera
,ScreenSpaceCameraController
, andGlobe
. Especially lines inCamera
like:@mramato @gberaudo @IanLilleyT