Convex hull face selection for contact generation clipping works using a simple heuristic:
Find the face planes which contain the closest point on the hull.
Of those face planes, choose the one which has a normal closest to the collision normal.
This works reasonably well, but if the hulls are poorly authored or were automatically generated (without a quality-guaranteeing processing phase), they may have multiple faces with very similar normals. This poses a problem for manifold stability- it takes very little motion to swap the representative from frame to frame. That's a recipe for jitter.
While little tricks like bias based on face index help, there are pathological cases where it can't help much. Consider a sliverlike face on a bottom edge that is very nearly coplanar with a larger bottom face. Trivial biases might end up preferring the sliverlike face. Other heuristics, like face area, may help more.
Also, for users reading this: avoid near coplanar faces. Try for at least 10 degrees between face normals. If possible, run your content through a convex hull simplifier (#61) of some sort to prune out unnecessary complexity. It's good for performance and stability!
Convex hull face selection for contact generation clipping works using a simple heuristic:
This works reasonably well, but if the hulls are poorly authored or were automatically generated (without a quality-guaranteeing processing phase), they may have multiple faces with very similar normals. This poses a problem for manifold stability- it takes very little motion to swap the representative from frame to frame. That's a recipe for jitter.
While little tricks like bias based on face index help, there are pathological cases where it can't help much. Consider a sliverlike face on a bottom edge that is very nearly coplanar with a larger bottom face. Trivial biases might end up preferring the sliverlike face. Other heuristics, like face area, may help more.
Also, for users reading this: avoid near coplanar faces. Try for at least 10 degrees between face normals. If possible, run your content through a convex hull simplifier (#61) of some sort to prune out unnecessary complexity. It's good for performance and stability!