godot-module-template/modules/jolt_physics/objects
Jorrit Rouwe 8a6d125ec2 Jolt Soft Body: Make default mass 1 kg and fix stiffness conversion
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.
2026-02-08 10:38:46 +01:00
..
jolt_area_3d.cpp Improve performance for shapeless objects when using Jolt Physics 2025-07-03 14:14:00 +02:00
jolt_area_3d.h Move server files into their subfolders 2025-09-30 19:39:39 -07:00
jolt_body_3d.cpp Jolt Physics: Reworked how gravity is applied to dynamic bodies to prevent energy increase on elastic collisions 2026-01-23 20:08:05 +01:00
jolt_body_3d.h Fix contacts not being reported properly when using Jolt Physics 2025-07-12 14:20:38 +02:00
jolt_group_filter.cpp
jolt_group_filter.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
jolt_object_3d.cpp Batch the adding of Jolt Physics bodies 2025-06-14 14:11:07 +02:00
jolt_object_3d.h Remove no-op locking in Jolt Physics module 2025-04-29 12:23:24 +02:00
jolt_physics_direct_body_state_3d.cpp Use RequiredParam/RequiredResult in some high value places 2025-12-02 10:44:12 -06:00
jolt_physics_direct_body_state_3d.h Use RequiredParam/RequiredResult in some high value places 2025-12-02 10:44:12 -06:00
jolt_shaped_object_3d.cpp Improve performance for shapeless objects when using Jolt Physics 2025-07-03 14:14:00 +02:00
jolt_shaped_object_3d.h Improve performance for shapeless objects when using Jolt Physics 2025-07-03 14:14:00 +02:00
jolt_soft_body_3d.cpp Jolt Soft Body: Make default mass 1 kg and fix stiffness conversion 2026-02-08 10:38:46 +01:00
jolt_soft_body_3d.h Jolt Soft Body: Make default mass 1 kg and fix stiffness conversion 2026-02-08 10:38:46 +01:00