-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General stability improvements #625
Merged
Merged
Conversation
This file contains 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
… contact velocity
…hold based on user-defined length units
This was referenced May 5, 2024
Merged
3 tasks
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.
This PR implements several automatic stability fixes (that you will get automatically just by updating the rapier version), as well as some optional ones. Here is a short summary:
soft-ccd
: a form of CCD based on predictive contacts. This is helpful for objects moving moderately fast. This form of CCD is generally cheaper than the normal (time-dropping) CCD implemented so far. It is possible to combine both soft-ccd and time-dropping ccd.contact_skin
property to colliders. This forces the solver te maintain a gap between colliders with non-zero contact skin, as if they had a slight margin around them. This helps performance and stability for thin objects (like triangle meshes).IntegrationParameters::length_units
to automatically adjust internal thresholds when the user relies on custom length units (e.g. pixels in 2D).This PR also adds a rust port of several test cases from the Solver2d playground. See the 2D examples files with a name starting with
s2d
.(Some of the videos below are low-resolution to stick with github’s 10MB video limit.)
Stacking improvements
General stacking improvements will be obtained automatically by updating to the newest version of rapier.
Stacking.-.lowres.mp4
Popping effect
The following video shows improvements in handling the "pop" effect due to penetrations. Here, objects were initialized in a penetration state.
Popping.effect.-.lowres.mp4
Dynamic triangle meshes
The following video shows improvements on handling triangle meshes attached to dynamic rigid-bodies. There is still some research needed before making them completely stable, but this is a step in the right direction.
All the meshes here were initialized with the
TriMeshFlags::FIX_INTERNAL_EDGES
flag, and are given acontact_skin
equal to 0.1.Dynamic.triangle.meshes.-.lowres.mp4
Contact skin
The following shows the difference between collisions with and without contact skin.
The colliders on the left part of the video were initialized without any contact skin. Colliders on the right were initialized with
.contact_skin(0.2)
. Notice the gaps remaining between colliders on the right.Contact.skin.-.lowres.mp4
Soft CCD
The following shows the effect of soft-CCD. The moving think object is initialized with a velocity of
-100.0
along the vertical axis.Left: no soft-CCD, Right: soft-CCD enabled with a max prediction distance of 10.0.
Soft-ccd.mp4