Inset boundary particles during dynamic collider sampling #66
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.
When switching the dynamic bodies in the simple2.rs example to use dynamic collider sampling, the result looks like there is an invisible force field surrounding the objects:
This is happening because boundary particles are placed precisely on the collider surface, so they protrude by the particle radius, making the body behave as if it was bigger.
This PR insets these boundary particles by their radius along the computed normal, which fixes that problem and makes the colliders roughly match the static sampling that is used for them by default.
It does come with a drawback though: particles now have an easier time slipping out of concave shapes with zero thickness, such as the heightfield used by the examples, so now there's some fluid leakage.