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
Scale bounding sphere #1155
Scale bounding sphere #1155
Conversation
@@ -701,6 +701,7 @@ define([ | |||
* @exception {DeveloperError} sphere is required. | |||
* @exception {DeveloperError} transform is required. | |||
*/ | |||
var radiusScratch = new Cartesian3(); |
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.
This needs a better name. Radius is a scalar. This is a vector.
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.
The variable also needs to be placed before the JSDoc comment above, so that the JSDoc is correctly attached to BoundingSphere.transform
.
@pjcozzi anything else? |
Cartesian3.clone(transformCart4, result.center); | ||
result.radius = sphere.radius; | ||
result.center = Cartesian3.clone(transformCart4, result.center); | ||
result.radius = Math.max(Cartesian3.magnitude(Matrix4.getColumn(transform, 0, columnScratch)), Cartesian3.magnitude(Matrix4.getColumn(transform, 1, columnScratch)), Cartesian3.magnitude(Matrix4.getColumn(transform, 2, columnScratch))) * sphere.radius; |
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.
I meant make one call to Math.max
. I would still split the arguments across multiple lines despite what the Eclipse formatter wants. We don't have lines this long anywhere else in Cesium.
@hpinkos can you merge in master? Is this ready? |
Conflicts: Source/Core/BoundingSphere.js
@pjcozzi this is ready |
fixes Issue #1153