소스 검색

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 {