浏览代码

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).
Adam Simpkins 2 月之前
父节点
当前提交
71e3a229f6
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      modules/jolt_physics/objects/jolt_soft_body_3d.cpp

+ 1 - 0
modules/jolt_physics/objects/jolt_soft_body_3d.cpp

@@ -606,6 +606,7 @@ void JoltSoftBody3D::set_transform(const Transform3D &p_transform) {
 		vertex.mPosition = vertex.mPreviousPosition = relative_transform * vertex.mPosition;
 		vertex.mVelocity = JPH::Vec3::sZero();
 	}
+	wake_up();
 }
 
 AABB JoltSoftBody3D::get_bounds() const {