tilting is not working correctly, when tilting it brings us below the map

1. A concise explanation of the problem you’re experiencing.

When we are runniong a Cesium application and trying to tilt the map, sometimes we end up below the surface of the map. It looks like we see the map from below.

We tried to disable tilting by adding the following line:

viewer.scene.screenSpaceCameraController.enableTilt = false

But this doesn’t seems to work

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

viewer.scene.screenSpaceCameraController.enableTilt = false

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

Try to achieve a better user experience

4. The Cesium version you’re using, your operating system and browser.

1.44.0

Thanks for letting us know! I’ve noticed that too, and it’s definitely something I’d like to improve. We haven’t been able to pin down exactly when it occurs. If you have a way to consistently recreate it that’d definitely help!

Hi Omar,

Thank you for the reply
in a sandbox app these are the settings we are currently using.

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
viewer.scene.screenSpaceCameraController.minimumZoomDistance = 100.0;
viewer.scene.screenSpaceCameraController.minimumCollisionTerrainHeight = 100;

it occurs consistenly in our application

Hi Omar,

I managed to create a way to consistently recreate it.
When you are zoomed in to the maximum, collision detection works fine.

When you are not zoomed in and the detailed tiles are not loaded yet, you can tilt through the map.

Collision detection only seems to work when the most detailed layer from the map is loaded.

I hope this helps,

kind regards

I added this video for explanation.

When zoomed in tilting works as expected, when zoomed out tiling can bring me below the map.

Do you have an idea to mitigate the problem?

many thanks

sorry wrong link

Thanks for recording that and for the specific instructions! This will definitely help.

I found an issue that’s been tracking this. I linked to your instructions there:

Hopefully this help contribute to a fix soon!

We experience the problem (the camera goes below the terrain), too. To duplicate it:

1. Visit our site (Wasatch Backcountry Skiing Desktop Map).
2. Shift+click anywhere on the terrain and push your mouse away from you (which lowers the camera) until the camera stops (due to a collision with the terrain).
3. Without releasing the mouse button or Shift key, pull the mouse back toward you to raise the camera, and then again push the mouse away from you to lower the camera.

The camera will (almost always) go below the surface of the terrain and Cesium will crash with an "Invalid array length".

Note this seems to only happen if you perform the above steps without releasing the mouse button after the camera "collides" with the terrain. So to duplicate it, it's best to perform this test immediately after loading the page.

Thanks for the additional test case! There is a workaround described here that might work for that particular case: