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

Ported Tomas Akenine-Moller's triangle-AABB implementation to javascript #115

Merged
merged 5 commits into from
Jun 29, 2016

Conversation

likangning93
Copy link
Contributor

Tomas Akenine-Moller's Reference C implementation can be found here.
Theory page here.

In preparation for uniform grid acceleration in Ambient Occlusion as well as future spatial datastructures.
Should this actually make its way into Cesium at some point?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 93.632% when pulling 9d61bea on triBoxOverlap into 7308cb0 on ao-master.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 28, 2016

Should this actually make its way into Cesium at some point?

Yes, something like a CesiumCore or CesiumGeometry module as part of the Cesium 2.0 effort, CesiumGS/cesium#2524.


/**
* Function and helpers for computing the intersection between a static triangle and a static AABB.
* Adapted from Tomas Akenine-Möller's public domain implementation: http://www.cs.lth.se/home/Tomas_Akenine_Moller/code/
Copy link
Contributor

Choose a reason for hiding this comment

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

Still add this to LICENSE.md as public domain so all third-party code is referenced from there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like the third party code section is pretty out of date, should I open an issue for that or just update it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Updating it as part of this PR would be fine and appreciated.

@likangning93
Copy link
Contributor Author

Updated: addressed the style issues and added Cesium's AxisAlignedBoundingBox. I will add tests in another commit.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2016

Looks good. Thanks for updating LICENSE.md.

@likangning93
Copy link
Contributor Author

Updated! I added a whole bunch of additional tests, and the fact that running jasmine over the whole pipeline still takes less than a second is very encouraging.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 94.009% when pulling c3da1de on triBoxOverlap into 7308cb0 on ao-master.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2016

Coverage is only 93% for this file. Can we get it to 100%?

https://coveralls.io/builds/6802561/source?filename=lib%2FtriangleAxisAlignedBoundingBoxOverlap.js

@likangning93
Copy link
Contributor Author

I got coverage to go up a little by fiddling with some of the specs, but as discussed offline getting coverage to 100% will be difficult as the algorithm is heavily optimized for early return.

I think we have enough specs to be pretty confident in this port of the algorithm, though.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 94.04% when pulling 45235dc on triBoxOverlap into 7308cb0 on ao-master.

@likangning93
Copy link
Contributor Author

Another thought: could we get in touch with Dr. Akenine-Möller about late return edge case triangles?

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2016

I'll merge this now, and will try to get you in touch offline.

@pjcozzi pjcozzi merged commit 9782c35 into ao-master Jun 29, 2016
@pjcozzi pjcozzi deleted the triBoxOverlap branch June 29, 2016 17:44
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