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

Enhanced internal edge removal #612

Open
Jondolf opened this issue Jan 1, 2025 · 0 comments
Open

Enhanced internal edge removal #612

Jondolf opened this issue Jan 1, 2025 · 0 comments
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Enhancement New feature or request

Comments

@Jondolf
Copy link
Owner

Jondolf commented Jan 1, 2025

Ghost collisions are a very common and frustrating problem in game physics. A common case where they may occur is when an object is sliding along a seemingly smooth surface formed by several shapes joined together, such as a tilemap; the body can hit the edges where the colliders meet, causing jarring and unrealistic behavior as the object bumps into invisible edges.

Parry already supports fixing internal edges for triangle meshes and heightfields. However, the same is not supported for other compound shapes or separate colliders. Objects can still hit internal edges of cuboids that are flush next to each other.

How can we improve on this?

I largely consider proper internal edge removal to still be an open problem, but I suspect that there is more we could do.

Jolt supports enhanced internal edge removal that appears to work for any compound shape, as long as the vertices of sub-shapes match within some epsilon threshold (i.e. "T-edges" are not supported). It is built based on the ideas in Contact generation for meshes by Pierre Terdiman (https://www.codercorner.com/MeshContacts.pdf). There is a video showcasing it here.

Jolt's approach only works for shapes belonging to a single body. For example, a tilemap consisting of separate bodies for each tile can still have internal edge problems, but for a single compound shape, they should be fixed. This is because making it work cross-body would have serious performance implications and hinder parallelism in their case. If we implement this, we might require similar limitations, though I do want to experiment to see if it's possible to work around them.

@Jondolf Jondolf added C-Enhancement New feature or request A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality labels Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant