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

Scale bounding sphere #1155

Merged
merged 6 commits into from Sep 24, 2013
Merged

Scale bounding sphere #1155

merged 6 commits into from Sep 24, 2013

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Sep 18, 2013

fixes Issue #1153

@@ -701,6 +701,7 @@ define([
* @exception {DeveloperError} sphere is required.
* @exception {DeveloperError} transform is required.
*/
var radiusScratch = new Cartesian3();
Copy link
Contributor

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.

Copy link
Contributor

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.

@hpinkos
Copy link
Contributor Author

hpinkos commented Sep 18, 2013

@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;
Copy link
Contributor

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.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 23, 2013

@hpinkos can you merge in master? Is this ready?

hpinkos added 2 commits September 23, 2013 15:36
Conflicts:
	Source/Core/BoundingSphere.js
@hpinkos
Copy link
Contributor Author

hpinkos commented Sep 23, 2013

@pjcozzi this is ready

pjcozzi added a commit that referenced this pull request Sep 24, 2013
@pjcozzi pjcozzi merged commit 55e945d into master Sep 24, 2013
@pjcozzi pjcozzi deleted the scaleBoundingSphere branch September 24, 2013 14:57
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.

None yet

3 participants