I would argue that you should make your own system over using Godot’s current softbody implementation. SoftBody3D does not implement the concept of plastic deformation which is the permanent deformation you’re looking for. Moreover, Godot Docs states:[1]
This doesn’t mean you need to create a complex system. Simulating the effect of plasticly deformed stiff materials, such as the metal on a car, can be done in a simple manner if you’re willing to compromise on the simulation’s degree of realism.
Proposed Method
- Create a copy of the vehicle’s mesh for deformation purposes (
meshDef) - When the body detects a collision, note the impact force (
imp_for) and impact point (imp_pnt) - Compute the deformation for vertices within a specific radius of the
imp_pntand modulate the degree of deformation with distance and scale byimp_for. - Then apply the deformed mesh,
meshDef, to the MeshInstance and accompanying collider of your vehicle.
Sidenote
The proposed method will create stretching artefacts as there is no method to preserve the surface area of the non-deformed mesh.
The proposed method is also nowhere close to BeamNG’s implementation which uses a component-based framework of springs and nodes to simulate volumetric deformation.
If you want to create a similar system, I would recommend looking at the documentation for BeamNG’s JBeam framework.
Additional Resources
- Source implementation for Godot’s SoftBody3D
- Source implementation for Bullet Physics’ Softbody Implementation (Godot’s is based on this)
- MeshInstance3D Class Reference
- ConcavePolygonShape3D Class Reference (for use with
CollisionShape3D)