Before this change, the default SoftBody3D mass was 0 which would set the mass of every vertex to 1 kg. The SoftBody3D UI in this case shows 0.001 kg, while for a cloth with a reasonable number of subdivisions the actual weight would be in the order of 1000 kg. This weight is likely to be much more than the weight of other RigidBody3D's in the scene (their default weight is 1) causing unrealistic interactions. * Changed the default mass for a soft body to 1 kg, this mass is distributed uniformly across all soft body vertices. This matches what Godot Physics does. * Added a missing call to _update_mass() so that calling set_mass after creation actually updates the mass now. * Added an error check to set_mass() so that it no longer accepts zero mass as input. * Fixed the conversion from godot stiffness to Jolt's compliance with a formula that was derived from the XPBD vs PBD equations. The previous conversion routine was determined experimentally and did not account for vertex mass. This meant that when the vertex mass became really low, the simulation became unstable. |
||
|---|---|---|
| .. | ||
| jolt_area_3d.cpp | ||
| jolt_area_3d.h | ||
| jolt_body_3d.cpp | ||
| jolt_body_3d.h | ||
| jolt_group_filter.cpp | ||
| jolt_group_filter.h | ||
| jolt_object_3d.cpp | ||
| jolt_object_3d.h | ||
| jolt_physics_direct_body_state_3d.cpp | ||
| jolt_physics_direct_body_state_3d.h | ||
| jolt_shaped_object_3d.cpp | ||
| jolt_shaped_object_3d.h | ||
| jolt_soft_body_3d.cpp | ||
| jolt_soft_body_3d.h | ||