The Wayback Machine - https://web.archive.org/web/20220709034451/https://github.com/CesiumGS/cesium/issues/10303
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

screenSpaceCameraController.maximumZoomDistance not work,when I set enableCollisionDetection to false. #10303

Open
andy259 opened this issue Apr 19, 2022 · 4 comments
Labels
category - camera category - doc good first issue

Comments

@andy259
Copy link

@andy259 andy259 commented Apr 19, 2022

I wanted maximumZoomDistance working on any case.But when I set enableCollisionDetection to false,camera can higher than maximumZoomDistance value.

Sandcastle example: here is the example

The code is below:

const viewer = new Cesium.Viewer("cesiumContainer");
viewer.scene.camera.setView({
    destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
});
viewer.scene.screenSpaceCameraController.maximumZoomDistance = 300000;

Sandcastle.addToolbarButton("EnableCollisionDetection", function () {
   viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
});

Sandcastle.addToolbarButton("DisableCollisionDetection", function () {
   viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
});

Browser: Chrome 100.0.4896.88

Operating System: Windows 11, 22000.613

@ggetz
Copy link
Contributor

@ggetz ggetz commented Apr 19, 2022

I believe this may be by design. If you look at the source code, we explicitly check for enableCollisionDetection before adjusting for the maximumZoomDistance. If its true the behavior is intentional, it's not documented. So I think the right thing to do here is leave the behavior as is, but update the documentation to make it clear that enableCollisionDetection effects maximumZoomDistance and minimumZoomDistance

@ggetz ggetz added good first issue category - doc labels Apr 19, 2022
@andy259
Copy link
Author

@andy259 andy259 commented Apr 20, 2022

I don't understand why it's designed this way.

I believe this may be by design. If you look at the source code, we explicitly check for enableCollisionDetection before adjusting for the maximumZoomDistance. If its true the behavior is intentional, it's not documented. So I think the right thing to do here is leave the behavior as is, but update the documentation to make it clear that enableCollisionDetection effects maximumZoomDistance and minimumZoomDistance

@ggetz
Copy link
Contributor

@ggetz ggetz commented Apr 20, 2022

enableCollisionDetection is working as an on/off switch for all camera limits, including minimum zoom, maximum zoom, and collision with terrain.

Could you describe your use case in more detail? There's been some interest in taking a look at the camera API in general to make it easier to use, and knowing more could help that effort.

@andy259
Copy link
Author

@andy259 andy259 commented Apr 21, 2022

Thanks @ggetz
In my case,my scene is a small area and I have some model in the underground.
So,I both limited user maximum zoom distance and user can go undergound the globe.

enableCollisionDetection is working as an on/off switch for all camera limits, including minimum zoom, maximum zoom, and collision with terrain.

Could you describe your use case in more detail? There's been some interest in taking a look at the camera API in general to make it easier to use, and knowing more could help that effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category - camera category - doc good first issue
2 participants