-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
camera.getPickRay exception when Scene is not rendered #10139
Conversation
Thanks for the pull request @srothst1!
Reviewers, don't forget to make sure that:
|
The following updates have been made to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @srothst1 ! Before you get too deep in the specs, I have a suggestion about the approach here.
Co-authored-by: Gabby Getz <gabby@cesium.com>
Hi @ggetz. I am wondering if you have any feedback on the Travis CI build failures. When I run our specs using Jasmine on my local build, I seem to be getting various errors. These errors seem to occur even if I revert my branch back to 918c253, which had no issues when it was committed. Edit: It seems like the last commit did not fail the Travic CI build. I suspect that the error was related to our above conversation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, looking great @srothst1 ! I just have one small comment.
Yes, eslint was reporting an error and failing CI. You can check for eslint errors locally before you commit by running |
Co-authored-by: Gabby Getz <gabby@cesium.com>
Hi @ggetz. Please let me know if there is anything else that I need to take care of before this can be merged. |
Looks good, thanks @srothst1 ! |
This is a breaking change and should probably be listed as such. |
@ggetz should I open up another PR that fixes |
Hi @ggetz. Yes, I will open up another PR 👍 |
Without TypeScript, I would agree with you, but with TypeScript, yes. The below TypeScript compiles fine with let result: Ray;
const camera = new Camera(new Scene({ canvas: canvasElement }));
result = camera.getPickRay(new Cartesian2(0, 0)); With the error
But more philosophically, changing a return type should always be documented as a breaking change because any code calling |
The goal of this pull request is to address the issue with
camera.getPickRay
outlined in #10125camera.getPickRay
is currently throwing an exception that is not consistent with the rest of ourCamera
spec whenScene
is not rendered. Based on the documentation (see pickEllipsoid, etc.) and various tests that I ran, pick operations are supposed to returnundefined
if the pick fails.Currently, after the viewer is updated as follows:
I receive this error:
I am using this sandcastle demo for my testing.
A few lingering TODO items:
CHANGES.md
Camera
spec forgetPickRay