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
Allow applications to control terrain adjustment suspension #6012
Allow applications to control terrain adjustment suspension #6012
Conversation
@gberaudo, thanks for the pull request! Maintainers, we have a signed CLA from @gberaudo, so you can review this at any time. I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@gberaudo to continue our conversation from the other issue, I'm trying to understand how this helps things. Won't it let the camera just get stuck under terrain instead? |
Hi @mramato, With With The improvement is that the application can choose which mode it wants and change it at will. For example, it could be Does it clarify? |
4c8497a
to
e14da77
Compare
Hi @mramato, have you been able to look again into this PR? I have rebased the PR to fix the conflict in CHANGES.md. |
In sandcastle, can be tested with: var viewer = new Cesium.Viewer('cesiumContainer'); var scene = viewer.scene; var globe = scene.globe; var controller = scene.screenSpaceCameraController; controller.minimumZoomDistance = 3000; var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({ url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles' }); viewer.terrainProvider = cesiumTerrainProviderMeshes; setInterval(function() { var carto = Cesium.Cartographic.fromCartesian(scene.camera.position); console.log(carto.height - globe.getHeight(carto)); }, 10); scene.camera.enableTerrainAdjustmentWhenLoading = true;
e14da77
to
a4123de
Compare
Done @ggetz. Thanks for the follow up. |
Thanks @gberaudo, sorry for the delay here, I've had almost no time to work on Cesium at all the last few months. I'm a bit confused by your example, why are you setting My primary issue with this change is that with the new camera mode creates other bugs, such as causing We certainly want to make Cesium's camera more usable, but I'm not entire convinced this is the right way to do it. I would be interested to hear what @bagnell (I did talk to him a little offline), @emackey , and @pjcozzi think. I still want to better understand the fundamental use case (I assume it's get rid of the "jump"?). If we do decide to take this change, I think we can come up with a friendlier name for the property and we would also need to document potential issues, like the setView/flyTo I mention above. |
@mramato, I used 3000m so that the issue is immediately visible.
To be optimal, the functionality I propose require collaboration from the application (to handle flyTo/setView near the ground). That being said, in our application I simply set A solution, that would not require application collaboration might be to:
@pjcozzi, in comparison, the proposed change is straightforward and immediately brings some improvement to the persons affected by the current behaviour. In the meanwhile, I am relying on the Camptocamp fork at https://www.npmjs.com/package/@camptocamp/cesium which contains an equivalent workaround. |
Thanks again for the pull request! Looks like this pull request hasn't been updated in 30 days since I last commented. To keep things tidy should this be closed? Perhaps keep the branch and submit an issue?I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
I know this may be dead now, but I just wanted to provide a use case for why this fix could be useful. In our application we store "views", which are basically a saved camera location and rotation (and also loads relevant imagery layers and entities). The idea being that a user can save a "view", and then load it up again and see the exact same scene. At the moment, this doesn't work because the camera jumps to the location, but then gets juggled up and down as the terrain loads in, ending up in a different spot. This is particularly troublesome when a view is setup to be at a certain height right next to a set of 3d tiles or a model, since it can end up looking well above or below the desired part of the model. |
@ediebold The specific behavior you describe was a bug and should be fixed in the with the next release of Cesium on Monday. See #6989 The camera was never supposed to jump while terrain was being loaded in, only once all terrain tiles are loaded (and only if the camera was underground in a completely loaded scene). If you have a chance to try out master before the release, it would be great if you could confirm the fixed behavior for us. |
Thanks again for your contribution @gberaudo! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
Thanks again for your contribution @gberaudo! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
Thanks again for your contribution @gberaudo! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with |
Has this fixed been merged into a recent Cesium release? |
@bbehling-trimble no, this change was not merged. However, we had other significant improvements for streaming and loading terrain added in the CesiumJS 1.55 release. Learn more in this blog post: https://cesium.com/blog/2019/03/06/terrain-rendering-improvements/ |
@bbehling-trimble and other fixes related to the camera going under terrain were merged in #6989 |
I upgraded to v1.55 and I'm still able to get the camera under the surface |
@bbehling-trimble add any comments to #5837 please. Thanks! |
Fixes: #5999.
Fixes: #5837.
With this simple change, terrain adjustment suspension can be activated/disactivated at will by the application. The default behaviour stays unchanged.
In sandcastle, the code can be tested with:
This PR fixes issues where the camera sinks under the terrain, and after (a long) time jumps above the terrain.