Override mass properties for Area3D
when using Jolt Physics
#102029
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.
Fixes #101917.
Doing this resolves the assertion about "Invalid mass" when trying to use
ConcavePolygonShape3D
for anArea3D
.The reason for this assertion is that
Area3D
are implemented with what Jolt calls sensors, which are a type of body, and thus happen to have mass properties as well, which can't reasonably be calculated automatically for shapes likeConcavePolygonShape3D
.Note that concave shapes for an
Area3D
is problematic for a number of reasons, as mentioned in the documentation forArea3D
, but it seems to work on some basic level at least, and seems to be about as janky in Godot Physics already, so I guess it's fine to just allow it for now.