Update property/documentation of shape margins #75079
Merged
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.
Seeing as how the
margin
property ofShape3D
managed to make its way into 4.0-stable, despite not being used by Godot Physics, I figured we might as well make some changes to better support other physics engines.I rephrased the documentation to reflect that it's not only Bullet Physics that uses this, since it's also a thing in other GJK-based physics engines such as Havok, Jolt, Rapier, etc.
I also opened up the bounds of the property by changing the lower bound from 0.001 to 0 and adding the
or_greater
hint to allow for values greater than its upper bound. Jolt Physics (for example) has no issues using a margin of 0, apart from the performance drawbacks, and having 10 be a hard upper bound seemed somewhat arbitrary.