-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Contact query giving incorrect result for Frustums #157
Comments
Update: added unit test |
After further investigation (and producing a failing case with intersection_test), I eventually tried with f64 and it fixes the intersection_test failing case as well as the contact test I mentioned above. That said, I still get many jitters with the contact query even in f64, the behavior is still similar to the original video I posted. For now I will switch to rapier_f64/parry_f64 and just use the intersection_test which seems very stable in f64 mode. |
Here is my second failing unit test for intersection_test: |
Ok, was looking into this a bit more and read a little bit about EPA algorithm. It appears the EPA algorithm can go indefinitely as long as a better result is found (which is not the case here, at least for me it is not).
As you can see, the last one is an increase in distance, so it did not find a better one. Not sure if EPA algorithm ensures that we find a better distance every iteration or not, in which case the algorithm could just stop iterating if it finds a worse distance. Either way, 10000 iterations seem like a very large number. Maybe either a smaller number, eg 20, 50, or something based on the total polygon vertices(eg vertices * 5 or so). Or have it configurable. Also, if it does stop in that while there after a number of iterations, it should still return the contact, as it did find "something". Right now it returns None, which causes this issue. |
Hello!
First of all: thank you for the incredible library 😄
I am experiencing some unexpected behaviour and was wondering if someone could help me troubleshoot it. I want to test if two frustums are intersecting but it seems to be producing inconsistent results as can be seen in the video below, where I am showing the left frustum in green if I get
Some(Contact)
back fromrapier3d::parry::query::contact::contact
:frustum_intersection_jitter_2.mp4
Here is how I am implementing the test:
I'm using the same to_basic_mesh() function to display the frustum in my debug setup as in the video, so I'm quite sure the vertices are OK. For full details on the implementation you can check out this commit
Update: added unit test
I've added a unit test in my fork of parry, it can be seen here. Below is a screenshot with a visualisation of the two frustums which I copied from my engine directly into the test:
The test fails despite confirming that one point of the left frustum lies inside the right frustum:
The text was updated successfully, but these errors were encountered: