-
Notifications
You must be signed in to change notification settings - Fork 439
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: Fix Math::Intersection::sphereFrustum #482
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Squareys <[email protected]>
1dbe8ab
to
47e7f6b
Compare
Codecov Report
@@ Coverage Diff @@
## master #482 +/- ##
==========================================
- Coverage 77.12% 77.12% -0.01%
==========================================
Files 415 415
Lines 25498 25497 -1
==========================================
- Hits 19665 19664 -1
Misses 5833 5833
Continue to review full report at Codecov.
|
{0.0f, 0.0f, 1.0f, 0.0f}, | ||
{0.0f, 0.0f, -1.0f, 10.0f}}; |
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.
Hmm, so if there's multiple ways how to represent the same plane and the planes can be in any order, maybe the test could be made instanced with testing a few equivalent variants and expecting the same points get always the same result? That could harden it quite nicely.
And that could be done for all *Frustum
tests -- I see you already updated planeFrustum()
, so the same instancing change could be done to all.
EDIT: and while you're at it, I think including arbitrary (instanced) transformation in both the frustum planes and the points could make sense as well.
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.
Instanced test for permutating the plane order sounds like it would get out of hand in the test results pretty quickly, I think a loop with iteration description is probably enough?
Re the transformation: Do you mean offsetting/transforming the entire space, frustum and points, sphere's etc by a certain transform?
Hi @mosra !
As per #453 (Fix sphere frustum intersection), here's the fix plus extensive tests.
I made a conscious descision to mark "touching" geometries as non-intersection. Even though mathematically, the volume is not empty, it's infinitely small and hence useless for the main use case, which will be frustum culling.
Best,
Jonathan