1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

SoftBody3D: Add a property for scaling rest lengths of edge constraints

This commit is contained in:
Elzewyr
2025-05-12 19:33:39 +03:00
parent 0d8f33a74a
commit 9f67bf96fa
19 changed files with 126 additions and 0 deletions

View File

@@ -1104,6 +1104,20 @@ real_t GodotPhysicsServer3D::soft_body_get_linear_stiffness(RID p_body) const {
return soft_body->get_linear_stiffness();
}
void GodotPhysicsServer3D::soft_body_set_shrinking_factor(RID p_body, real_t p_shrinking_factor) {
GodotSoftBody3D *soft_body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL(soft_body);
soft_body->set_shrinking_factor(p_shrinking_factor);
}
real_t GodotPhysicsServer3D::soft_body_get_shrinking_factor(RID p_body) const {
GodotSoftBody3D *soft_body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL_V(soft_body, 0.f);
return soft_body->get_shrinking_factor();
}
void GodotPhysicsServer3D::soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) {
GodotSoftBody3D *soft_body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL(soft_body);