Skip to content
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

Fix Cylinder shape collision with margins when using GJK-EPA #47067

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp commented Mar 16, 2021

In the case of falling back to GJK-EPA algorithm to generate cylinder contact points, margins were never taken into account.

This fixes the depenetration phase for kinematic bodies and allows consistent floor detection for cylinder shapes.

Fixes #47058

Note: This change doesn't affect the Bullet physics backend or other shapes than cylinder.

@pouleyKetchoupp pouleyKetchoupp added this to the 4.0 milestone Mar 16, 2021
@pouleyKetchoupp pouleyKetchoupp requested a review from a team March 16, 2021 17:16
In the case of falling back to GJK-EPA algorithm to generate cylinder
contact points, margins were never taken into account.

This fixes the depenetration phase for kinematic bodies and allows
consistent floor detection for cylinder shapes.
@e344fde6bf
Copy link
Contributor

There still seems to be issues when you collide with the side of the cylinder:

cylinder-side-collisions.mp4

@e344fde6bf
Copy link
Contributor

Also, the collision normals for cylinders in an oblique orientation don't seem to be consistent and I'm getting some other weird jumps.

Here's walking on a slanted cylinder with Godot physics (floor angle not stable, and random jumps):

cylinder-oblique-godot.mp4

Here's a comparison with bullet:

cylinder-oblique-bullet.mp4

@pouleyKetchoupp
Copy link
Contributor Author

@e344fde6bf Thanks for catching all these cases! I've made a separate fix in PR #47084 for the specific capsule/cylinder issues.

@akien-mga akien-mga merged commit af08067 into godotengine:master Mar 17, 2021
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp pouleyKetchoupp deleted the cylinder-fix-margins branch March 18, 2021 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Godot Physics] Cylinder collision detection unstable with move_and_slide (3.2.4.rc5)
3 participants