CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.04k stars 3.51k forks source link

Unable to zoom in after setting the relative height of vertical exaggeration #11974

Open syzdev opened 6 months ago

syzdev commented 6 months ago

What happened?

This issue comes from https://github.com/CesiumGS/cesium/issues/11936 , I think this is another issue, so I created a new one. If the model is in the air, the reference height can be set to the center of the model, but the camera cannot zoom in.

sandcastle

GIF1

Reproduction steps

1.Exaggeration -> 5 2.Relative Height -> 9000 3.Mouse wheel -> zoom in ...

Sandcastle example

sandcastle

Environment

Browser: Google Chrome Version 124.0.6367.119 (Official Build) (64-bit) CesiumJS Version: 1.117 Operating System: Windows 11 22H2

ggetz commented 6 months ago

@jjhembd Could you please triage this issue?

jjhembd commented 6 months ago

Thanks for the report @syzdev! I can reproduce the problem on my machine, and it does look like a separate issue.

I can zoom all the way in if I turn off camera collision checks, as in this updated Sandcastle.

scene.screenSpaceCameraController.enableCollisionDetection = false;

It looks like ScreenSpaceCameraController is missing a check of scene.verticalExaggerationRelativeHeight somewhere, perhaps in the calculation of minHeight in the handleZoom method.

ggetz commented 2 months ago

Looking at https://github.com/CesiumGS/cesium/pull/12141, it appears the bounding volume is not properly accounting for exaggeration.