aephysics.distance: GJK, the shape cast, the time of impact - #3
Merged
Merged
Conversation
Box3D's distance.c in Aether: the simplex solved by Voronoi regions with barycentric coordinates, the support search warm-started from a cache whose metric is checked, the duplicate support as the termination; the shape cast by conservative advancement on the distance; the time of impact that builds a separation function (vertices, edges, a face of either) from the cached simplex and root-finds on it with false position and bisection in turn. The simplex's vertices are named fields, the cache's index pairs named ints; CastOutput moves here from the hull, which now has overlap_hull, shape_cast_hull and hull_proxy through it. test_distance.ae: the reference's four checks and 1,139 more -- spheres and capsules against boxes at analytic distances, overlap, the warm cache agreeing with a cold one over 200 poses, witness points inside their shapes and as far apart as the distance, no axis separating more than it, a rotating box falling on a slab in the time of impact (hit, miss, overlapped), and the hull's queries. bench/distance.ae against bench/distance_box3d.c: the same results (distance, cast and impact sums equal to the reference's float precision, GJK iterations within 0.01%) at 1.3-1.5x its time.
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 fifth layer: Box3D's
distance.cin Aether, asaephysics.distance.CastOutputmoves here from the hull; the hull gainsoverlap_hull,shape_cast_hullandhull_proxythrough this layer (the three functions deferred in aephysics.hull: quickhull and the half-edge hull #2).test_distance.ae: the reference's four checks plus 1,139 more — spheres/capsules against boxes at analytic distances, overlap, warm vs cold cache over 200 poses, witnesses inside their shapes and as far apart as the distance, no axis separating more than the distance, a rotating box falling on a slab (hit / miss / overlapped), the hull's queries.bench/distance.aevsbench/distance_box3d.c: identical results (sums equal to the reference's float precision, GJK iterations within 0.01%) at 1.3–1.5× its time.Differences: the simplex's four vertices are named fields (passed by value, never allocated) and the cache's index pairs are named ints.