Add continuous-collision infrastructure for deformables - #3463
Closed
smallquail wants to merge 1 commit into
Closed
Conversation
The discrete collision pipeline generates contact points at a configuration; this module prices gaps along trajectories: differentiable vertex-triangle, edge-edge and vertex-geom distance kernels with closest-point barycentrics, swept-volume candidate generation over the flex bounding-volume hierarchy, per-pair gap evaluation with the gradient's vertex weights, and a conservative advancement that bounds each contact pair's time of impact. Engine-internal, with no consumer in this change: it is the groundwork for continuous-contact (IPC-style) solvers for flex, which will arrive as callers. The mjcPair type carries the geometric identity of a candidate pair only; solver state (multipliers, ages) and cached linearizations belong to the consumer. The two lengths the module needs -- the standoff cap and the detection band -- are caller-supplied parameters, not constants. Flex-flex pairs measure their gap at the midsurface rather than skin-to-skin: where mesh geometry is tighter than the combined radii (a string threaded through a hem) a skin gap is permanently negative and the pair would be discarded as invalid, losing CCD coverage exactly where tunneling is likeliest. The broad phase adds the radii back into its reach, so detection range is unchanged. Tests cover the distance kernels, the geom sharp features, the pair gap with its gradient checked by central differences at every involved vertex, the conservative advancement (the analytic cap on a crossing sweep, the conservative closing-rate bound, the small-motion early-out), and candidate generation on stacked cloths (pairs within reach found, distant ones not).
yuvaltassa
reviewed
Aug 5, 2026
yuvaltassa
left a comment
Collaborator
There was a problem hiding this comment.
Can you ask @kbayes to review? I feel like the unit tests could be improved and also would his eyes on this re consistency with the rest of the collision code.
Collaborator
|
Superseded by b924ac6 |
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 standard discrete collision pipeline generates contact points at a configuration; this new module prices gaps along trajectories:
mjc_PtTri,mjc_SegSeg,mjc_GeomDist, plus sharp-feature extractionmjc_GeomVerts/mjc_GeomEdges);mjc_candidates);mjc_pairGap);mjc_advance).Design notes
mjcPairis the geometric identity of a candidate pair only. Solver state (multipliers, ages) and cached linearizations belong to the consumer, not to this struct — the module neither reads nor writes them.MJAPIon entry points only for tests, marked not a supported API). No user-visible behavior change; changelog notes the new infrastructure.Testing
engine_collision_continuous_test: distance kernels across their regions (interior/edge/vertex, crossing/collinear/parallel), geom signed distance and sharp features, the pair gap with its gradient verified by central differences at every involved vertex, the conservative advancement (analytic cap on a crossing sweep; the conservative closing-rate bound; small-motion early-out), and candidate generation on stacked cloths (pairs found at 2 mm, none at 0.5 m). Full suite: 1349/1349.