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

Triangle - AABB Intersection bug? #51

Closed
tneukom opened this issue Nov 22, 2018 · 2 comments
Closed

Triangle - AABB Intersection bug? #51

tneukom opened this issue Nov 22, 2018 · 2 comments

Comments

@tneukom
Copy link

tneukom commented Nov 22, 2018

Triangle triangle{ float3{0.0f, 0.0f, 0.0f}, float3{1.0f, 0.0f, 0.0f}, float3{0.0f, 1.0f, 0.0f} };
AABB aabb{ float3{-2.0f, -2.0f, -2.0f}, float3{2.0f, 2.0f, 2.0f} };

bool does_intersect = triangle.Intersects(aabb);

The triangle is contained in the AABB but does_intersect is false. It seems to be a problem when the triangle is parallel to the bounding box. I have SSE disabled.

@juj juj closed this as completed in ff4d2df Jan 14, 2019
@juj
Copy link
Owner

juj commented Jan 14, 2019

Thanks! Really good test case, it uncovered a corner case when triangle is perfectly parallel to one of the world axes. Fixed in above commit and added a test.

@tneukom
Copy link
Author

tneukom commented Jan 14, 2019

Awesome, thanks!

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

No branches or pull requests

2 participants