Add a 3D soft body physics demo #1228
Open
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.
An example of soft body physics (deformable objects) such as cloth, boxes and spheres.
Soft bodies support pinning points as well as applying impulses/forces to specific points, which can be useful for effects such as wind.
Soft bodies can interact with static, rigid and character bodies (and will be aware of rigid bodies' weight when doing so). However, soft bodies currently do not interact with other soft bodies, which means they will pass through each other.
The per-point impulse timer example also showcases how to attach nodes to specific points of a SoftBody3D. This can be used to make particles, meshes or even rigid bodies follow specific points.
The cloth soft bodies in this demo use a BaseMaterial3D with the Grow property enabled to prevent visible clipping into surfaces.
Controls:
For performance reasons, only 10 user-placed objects can be present at a time in this demo. The oldest objects will be removed when attempting to place more than 10 objects.
Preview