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

Math.cbrt -> Math.pow #6220

Merged
merged 3 commits into from
Feb 14, 2018
Merged

Math.cbrt -> Math.pow #6220

merged 3 commits into from
Feb 14, 2018

Conversation

likangning93
Copy link
Contributor

IE doesn't support Math.cbrt, which was causing point cloud 3D Tiles to fail.

@cesium-concierge
Copy link

Signed CLA is on file.

@likangning93, thanks for the pull request! Maintainers, we have a signed CLA from @likangning93, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@lilleyse
Copy link
Contributor

Nice fix.

@lilleyse lilleyse merged commit 1372cd1 into CesiumGS:master Feb 14, 2018
@lilleyse lilleyse deleted the cbrt branch February 14, 2018 20:33
@@ -466,7 +466,7 @@ define([
// Typical use case is leaves, where lower estimates of interpoint distance might
// lead to underattenuation.
var sphereVolume = content._tile.contentBoundingVolume.boundingSphere.volume();
content._baseResolutionApproximation = Math.cbrt(sphereVolume / pointsLength);
content._baseResolutionApproximation = Math.pow(sphereVolume / pointsLength, 1/3); // IE doesn't support cbrt
Copy link
Contributor

Choose a reason for hiding this comment

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

@lilleyse To prevent this problem in the future, should we add CesiumMath.cbrt that does the right thing depending on if Math.cbrt is available? This way if the "native" cbrt is faster or more accurate we get the benefit as well.

Also, keeping with convention, these should be 1.0/3.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened #6222

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.

4 participants