-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Entered unreachable code #176
Comments
I got this too (in rapier3d after despawning a bunch of things) |
In Rapier, this is typically caused by CCD, because that uses I don't have time to look into this too deeply right now, but for others wanting to debug this, here are some of my findings just based on looking at the codebase. The problemThe actual issue here is interesting. The non-linear time of impact query calls parry/src/query/nonlinear_time_of_impact/nonlinear_time_of_impact_support_map_support_map.rs Lines 128 to 130 in 8823198
Because the max distance is essentially the largest it can be, the result is expected to never be parry/src/query/nonlinear_time_of_impact/nonlinear_time_of_impact_support_map_support_map.rs Line 201 in 8823198
This indicates that the Potential reasons for returning
|
GJKResult::NoIntersection(_) => ClosestPoints::Disjoint, |
This either happens if (1) at any moment the minimum bound computed by GJK is larger than the maximum distance (it'd have to be Real::INFINITY
in this case), or if (2) GJK runs out of iterations before converging on a solution.
Finally, if the specific shape pair doesn't use GJK for closest_points
, it could be that its special implementation happens to have a bug that causes it to incorrectly return Disjoint
.
Debugging
If someone wants to debug this, I would recommend finding what exactly returns Disjoint
by adding logs in the appropriate places, like the "unreachable" match branch and the closest_points
implementations. If it's caused by GJK returning NoIntersection
, adding logs there to see what the shapes and isometries are could be useful.
Note that for me while I previously got the same panic, after updating to
See this comment for my reproduction using bevy_rapier |
Yep, it was changed temporarily to log an error instead of panicking in #192 until a proper fix is found |
I get
This should not happen. it's rather hard to provide a repro
The text was updated successfully, but these errors were encountered: