Description
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
Point radius can be configured as a project setting for all SoftBodies when using Jolt Physics, but you can't change it for a single soft body currently.
Point radius often has to be increased for thin cloth to prevent it from clipping through geometry it's colliding with:
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a Point Radius property to SoftBody3D.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The soft body point radius is set here: https://github.com/godotengine/godot/blob/428a762e9866afc41e9ba7fa334751142a81b432/modules/jolt_physics/objects/jolt_soft_body_3d.cpp#L148
We need to define a per-SoftBody3D property (defaulting to 0.01
) that can be read in that location, and use it to multiply the existing project setting. The project setting would then become a multiplier that defaults to 1.0
.
If this enhancement will not be used often, can it be worked around with a few lines of script?
You can use a vertex shader on the PlaneMesh to grow its vertices, e.g. by enabling Grow in a BaseMaterial3D. However, this will make the cloth appear more rounded, and it requires shader modifications for something that ought to be resolved using only physics properties:
Is there a reason why this should be core and not an add-on in the asset library?
This is about improving SoftBody3D usability.