CollisionQueries don't detect deep intersections #328
-
Hi! I'm considering to use this library for clash detection (no physics, no dynamics), just collsion checks between arbitrary meshes. // Add in a static object to test against. Note that the mesh triangles are one sided,
// so some of the queries whose centers are beneath the mesh do not generate any contacts.
var mesh = DemoMeshHelper.CreateDeformedPlane(20, 20, (x, y) => { return new Vector3(x * 5 - 50, 3 * MathF.Sin(x) * MathF.Sin(y), y * 5 - 50); }, Vector3.One, BufferPool);
Simulation.Statics.Add(new StaticDescription(new Vector3(0, 2, 0), Simulation.Shapes.Add(mesh))); So, is it possible somehow to force batcher include all physically intersected meshes? Also I need to understand how deep one mesh is inside anoher (negative distance). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The mesh could be made double sided by duplicating the triangles and flipping the winding on one of the duplicates, but that will have other consequences (like it being easier for stuff to get stuck behind walls). Mesh-mesh collision will not give you a very useful estimate of penetration distance; meshes are composed of infinitely thin one-sided triangles, and the contacts they produce reflect that. That's part of the reason why I frequently and strongly recommend against simulation configurations that would permit mesh-mesh collisions. Robust solid meshes (or an equivalently expressive solid concave representation) are on the longer-term to-do list. V1 had them, but I never liked the implementation. I wouldn't wait on me to get it done, though, I'm already pretty swamped. |
Beta Was this translation helpful? Give feedback.
The mesh could be made double sided by duplicating the triangles and flipping the winding on one of the duplicates, but that will have other consequences (like it being easier for stuff to get stuck behind walls).
Mesh-mesh collision will not give you a very useful estimate of penetration distance; meshes are composed of infinitely thin one-sided triangles, and the contacts they produce reflect that. That's part of the reason why I frequently and strongly recommend against simulation configurations that would permit mesh-mesh collisions.
Robust solid meshes (or an equivalently expressive solid concave representation) are on the longer-term to-do list. V1 had them, but I never liked the im…