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

Introducing a "maximumTilt" property for the Camera #9147

Closed
wants to merge 4 commits into from

Conversation

fnicollet
Copy link

Introduced a maximumTilt property for the Camera, that, if present, limits the camera's tilt.

Here is a sandbox sample to showcase this behaviour:

var viewer = new Cesium.Viewer("cesiumContainer");
var camera = viewer.camera;
camera.maximumTilt = 1.2;

camera.setView({
  destination: new Cesium.Cartesian3(
    1216394.1392207467,
    -4736348.59346919,
    4081293.9160685353
  ),
  orientation: {
    heading: 0.018509338875732695,
    pitch: -0.09272999615872646,
  },
});

The camera's pitch is limited (wether you use mousewheel-click + up/down or Ctrl+mouse up/down), which is currently impossible to do with the Cesium public API unless you re-code all the mouse/keyboard/touch gestures.

The maximumTilt value is expressed in radians. Degrees might have been more dev-friendly but most things seem to be expressed in radians in Cesium.

Follows-up on this PR which was never completed:
#7428

Added Business Geografic/fnicollet to the Contributors
The CLA for Business Geografic has been signed today.

Added a line in the CHANGES.md file. Should I wait for the PR to be created and update the file with the PR link or someone from Cesium will?

Fabien Nicollet added 4 commits September 11, 2020 14:33
Introduced a maxTilt property for the Camera, that, if present, limits the camera's tilt.
Added Business Geografic/fnicollet
@cesium-concierge
Copy link

Thanks for the pull request @fnicollet!

  • ❕ There was an error checking the CLA! If this is your first contribution, please send in a Contributor License Agreement.
    • Maintainers, this was the error I ran into while attempting to process the CLA check. Please resolve it to continue CLA checking.
    Error: The service is currently unavailable.
    
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.
@fnicollet fnicollet mentioned this pull request Sep 11, 2020
@OmarShehata
Copy link
Contributor

I can confirm we've received your corporate CLA.

@fnicollet
Copy link
Author

Hello,
Is there any change necessary before this PR can be reviewed?

Thanks,
Fabien

@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

1 similar comment
@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@jailln
Copy link

jailln commented Dec 14, 2020

Hello,
Is there any news on this PR ?
We would also really benefit from this feature in our project.
Thanks!

@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@fnicollet
Copy link
Author

Hello @OmarShehata ,

could this PR get reviewed please ?

Thanks,
Fabien

@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

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 @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

1 similar comment
@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@ebogo1
Copy link
Contributor

ebogo1 commented Sep 21, 2021

Might fix #9689?

@cesium-concierge
Copy link

Thanks again for your contribution @fnicollet!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

Copy link
Contributor

@sanjeetsuhag sanjeetsuhag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @fnicollet. From the discussions, this seems like a feature a lot of users might like. I have a small suggestion regarding the public API for this. Additionally, we expect all new features to have good test coverage, so it would be helpful if you could add those too.

* @type {Number}
* @default undefined
*/
this.maximumTilt = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to maximumZoomAmount and minimumZoomAmount, any interaction related limitations are better suited for the ScreenSpaceCameraController.

@fnicollet
Copy link
Author

Hello and thanks for your message,

This PR was added in September 2020 and since then, we are in the process or switching to another 3D library, so I won't really have time to work on those changes you ask for, especially since I have no idea how to write tests for Cesium for this specific use case.
Hopefully someone will take over and it gets added to Cesium, the code is quite straightforward, or maybe someone from the Cesium team can implement it

Fabien

@ggetz
Copy link
Contributor

ggetz commented Jan 28, 2022

Thanks for letting us know @fnicollet.

I'm going to close this PR then. If another member of the community is interested in picking this up, please let us know here!

Meanwhile, we are aware that the camera API is not the most user friendly, so we are evaluating improvements the Cesium team could make in the relative future. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment