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

Throw if Plane normal is not normalized #5304

Merged
merged 4 commits into from
May 12, 2017
Merged

Throw if Plane normal is not normalized #5304

merged 4 commits into from
May 12, 2017

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented May 10, 2017

I spent a little while this afternoon trying to track down a problem that was caused because someone created a plane where the normal wasn't normalized. The doc says it should be, so I added a DeveloperError check to make sure the normal vector has a magnitude of 1.0.

@bagnell
Copy link
Contributor

bagnell commented May 10, 2017

Where was the error? Should we also check that it is normalized in the from* functions?

@hpinkos
Copy link
Contributor Author

hpinkos commented May 10, 2017

My problem wasn't a bug in Cesium, someone made a mistake using Plane in another app. I just think throwing a DeveloperError here is helpful so next time it'll point out the mistake immediately.

@hpinkos
Copy link
Contributor Author

hpinkos commented May 10, 2017

And I don't think we need to put the check in the from functions because they each call new Plane

@bagnell
Copy link
Contributor

bagnell commented May 10, 2017

And I don't think we need to put the check in the from functions because they each call new Plane

Only when a result parameter isn't supplied.

@hpinkos
Copy link
Contributor Author

hpinkos commented May 10, 2017

Good point, I'll update that

@bagnell
Copy link
Contributor

bagnell commented May 10, 2017

My problem wasn't a bug in Cesium

Ok, I agree this is a good change.

@hpinkos
Copy link
Contributor Author

hpinkos commented May 11, 2017

@bagnell ready

@pjcozzi
Copy link
Contributor

pjcozzi commented May 11, 2017

Please document the @exception.

@hpinkos
Copy link
Contributor Author

hpinkos commented May 12, 2017

@pjcozzi done

@bagnell bagnell merged commit 466112a into master May 12, 2017
@bagnell bagnell deleted the checkPlaneNormal branch May 12, 2017 18:52
@mramato mramato mentioned this pull request Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants