-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Properly pass safe margin on initialization. #40377
Properly pass safe margin on initialization. #40377
Conversation
Fixes jitter.
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.
There is still some jitter, but it does fix the remaining jitter that isn't fixed with #35945.
Godot Physics 3.2
Godot Physics 3.2 with #35945
Godot Physics 3.2 with #40377
Godot Physics 3.2 with both #35945 and #40377
Just be clear, this addresses jitter seen in Godot Physics 3D not the jitter seen in the default Bullet Physics 3D, which is worse and completely solved with #35945.
It's also worth noting that the same solution doesn't work in 2D, because the minimum contact depth in 2D is set to 0.005 (in 3D it is 0.00001). Setting the margin to 0.001 in 2D results in #37798 (which I explain here: #37798 (comment)).
Finally, I notice that it doesn't display this value in the CollisionShape
Margin
field in the editor, but that's a separate issue.
@madmiraal Jitter should only appear when the advance per frame (usually due to gravity) is less than the margin. If small enough, its not a problem in practice. You can reduce the safe marging even further if you want until you stop seeing it, but that will give you numerical precision errors as you move away from the origin. The default value (fixed now) is a good tradeoff. |
Thanks! |
Cherry-picked for 3.2.3. |
Fixes jitter.
This bug was introduced by #12713 but it was masked for a long time until f2e5405 exposed it.