aephysics.triangle_manifold: one mesh triangle against sphere, capsule, hull - #5
Merged
Merged
Conversation
…e, hull Box3D's triangle_manifold.c in Aether: the back side culled with hysteresis, the closest point on a triangle by region with its feature, GJK for the shallow sphere and capsule cases, the separating axis test for the deep ones -- the triangle's face, the hull's faces, the edge pairs whose arcs cross, the triangle's edges as zero-area faces with a side normal so the axis with a capsule points out of the triangle -- the SAT cache tried first (a face reused only when not deep, an edge only when its separation held), the hull face refused as reference when it opposes the triangle, the edge contact when the face has nothing or one point and the edge is clearly better, and GJK last so nothing tunnels. The feature the contact came from is recorded for the mesh contact's ghost-collision reduction. test_triangle_manifold.ae: 1,540 checks from the triangle parts of test_manifold.c (the tipped cube's edge on a tilted triangle edge from speculative gap into deep overlap, the edge axis carrying the cull, the parallel pair through the rejection threshold, the edge sweep against the cross product, the capsule pushed across an edge and straddling the face) plus the sphere on every feature, the resting cube, the back-side hysteresis and the cache. bench/triangle.ae against bench/triangle_box3d.c: the same manifolds (point counts, cache hits and separation sums equal); triangle-hull within 10% cold and warm, the capsule 1.35x, the sphere twice as fast.
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 seventh layer: Box3D's
triangle_manifold.cin Aether, asaephysics.triangle_manifold— what a mesh or height field will collide through.closest_point_on_triangleby Voronoi region with the feature; GJK shallow for sphere/capsule; the SAT deep (triangle face, hull faces, arc-crossing edge pairs, the triangle's edges as zero-area faces with a side normal); the SAT cache tried first; a hull face refused as reference when it opposes the triangle (ghost collisions); the edge contact when the face finds nothing or is clearly worse; GJK as the last resort. The triangle feature is recorded on the manifold for the mesh contact's reduction.test_triangle_manifold.ae: 1,540 checks — the triangle parts of the reference'stest_manifold.c(tipped cube on a tilted triangle edge into deep overlap, the edge axis carrying the cull, parallel pair through the threshold, the edge sweep against the cross product, capsule across an edge and straddling the face) plus the sphere on every feature, a resting cube, the back-side hysteresis and the cache.bench/triangle.aevsbench/triangle_box3d.c: identical manifolds (point counts, cache hits, separation sums). Triangle–hull within 10% cold and warm; capsule 1.35×; the sphere case twice as fast.One aetherc quirk worked around (a module constant inside a struct literal in a
returnis not resolved); the constants are restated locally with a note.