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

@@ -1126,6 +1126,20 @@ real_t JoltPhysicsServer3D::soft_body_get_linear_stiffness(RID p_body) const {
return (real_t)body->get_stiffness_coefficient();
}
void JoltPhysicsServer3D::soft_body_set_shrinking_factor(RID p_body, real_t p_shrinking_factor) {
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL(body);
return body->set_shrinking_factor((float)p_shrinking_factor);
}
real_t JoltPhysicsServer3D::soft_body_get_shrinking_factor(RID p_body) const {
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL_V(body, 0.0);
return (real_t)body->get_shrinking_factor();
}
void JoltPhysicsServer3D::soft_body_set_pressure_coefficient(RID p_body, real_t p_coefficient) {
JoltSoftBody3D *body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL(body);