-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Ignore Bullet collision contact points with distance = 0 #44726
Conversation
In case a collision has 0 distance, we would have both the manifolds excluded. This may lead to some flickering, even if the collisions are still detected. I wonder if exist another way to know if a manifold is generated because of CCD. Do you know? |
The only thing that changes is whether or not a distance of exactly |
What I mean is that, let's suppose there is a collision and the penetrations between these two objects oscillates between |
Bullet requires the penetration depth to be greater than the margin before considering it a collision; so Bullet wouldn't consider a distance of exactly Do you have a scenario where two objects would oscillate between exactly |
Well, it depends on the shapes pair, since each shape margin behave differently.
From time to time it may become |
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.
Looks good, Thanks!!
cc @akien-mga
Cherry-picked for 3.5. |
Currently, Godot processes all Bullet collision manifolds as long as the distance is less than or equal to 0 i.e. a collision has occurred. When CCD is enabled, Bullet creates an additional collision manifold with the CCD results. This manifold sets the collision point distance to 0 if a collision occurs. Therefore, when a CCD collision is detected, this manifold is processed too, when it shouldn't.
This PR ensures that Godot doesn't process Bullet collision manifolds' contact points with a distance of 0; so it won't process the additional collision manifold created by CCD.
Fixes #44644.