mesh_contact: a convex shape against a mesh or height field - #14
Merged
Merged
Conversation
aephysics.mesh_contact, the world-free part of Box3D's mesh_contact.c in Aether: the triangles under the convex shape's bounds cached and refreshed only when the shape leaves the bounds they were queried with, each triangle keeping its simplex and separating-axis warm starts across a refresh; a manifold per triangle in the convex shape's frame; the acceptance rules that stop a shape crossing an interior edge or vertex from colliding with the seam (a triangle face always, a hull face when it lies with the triangle or is deep, the rest tentative -- spheres by nearest-first feature ownership, hulls and capsules skipping only the flat edges an accepted triangle owns); clusters by manifold and triangle normal within cos 5 degrees; and the four-point cull (the farthest pair, the largest triangle, the most area outside). The results live in the caller's arena. What the reference does next (matching the old manifolds for warm starting, the materials, rolling resistance and tangent velocity) is the contact's and comes with the dynamics. test_mesh_contact.ae (ours; the reference tests this through its world): the cull on placed points, a box on a grid mesh with the cache kept and refreshed, a sphere on an interior vertex and edge (one point), a capsule across triangles, a box on a height field and on a ridge, and the mesh under a transform. 64 checks. Two reference quirks kept and noted: the cull's tie rule and a hull face's far clip points. bench/mesh_contact.ae runs alone (the reference's needs its world): a box dragged across a wave at 3.2 us a step, a sphere at 0.7 us.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fourteenth layer: the world-free part of Box3D's mesh_contact.c as
aephysics.mesh_contact.MeshContactCachewithrefresh_cache: the triangles under the convex shape's bounds, refreshed only when the shape leaves the query bounds (margin + speculative distance), each triangle's simplex and SAT caches matched across a refresh by sorted index.compute_mesh_manifolds(cache, mesh_shape, xf_a, convex, xf_b, bounds_b, is_fast, enable_speculative, arena): a manifold per triangle in the convex shape's frame, the acceptance rules against ghost collisions, clusters within cos 5 degrees,reduce_cluster/cull_pointsto four points. Results live in the arena from the call's start; the caller reads them and winds the arena back.test_mesh_contact.ae: 64 checks of our own. Two reference quirks kept and documented: the cull's tie rule lets zero-area points through on their separation (collinear points can keep four), and a hull face's far clip points stay as speculative points.bench/mesh_contact.aeruns alone (the reference's function needs its world): box 3.2 us/step, sphere 0.7 us, capsule 3.7 us on a wave mesh.