Skip to content

Commit 71e3a22

Browse files
committed
Jolt physics: wake up a soft body when its transform changes
This updates `JoltSoftBody3D::set_transform()` to wake up the soft body after changing the transform. Previously, if you had a soft body that was sleeping in a steady state on a ground plane, and you then translated it upwards by 1 meter it would just hang in the air. Now it falls to the ground correctly. Issue #108090 has some details and an MRP (although that issue is mostly about other problems in SoftBody3D iteself).
1 parent e1b4101 commit 71e3a22

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/jolt_physics/objects/jolt_soft_body_3d.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ void JoltSoftBody3D::set_transform(const Transform3D &p_transform) {
606606
vertex.mPosition = vertex.mPreviousPosition = relative_transform * vertex.mPosition;
607607
vertex.mVelocity = JPH::Vec3::sZero();
608608
}
609+
wake_up();
609610
}
610611

611612
AABB JoltSoftBody3D::get_bounds() const {

0 commit comments

Comments
 (0)