Browse Source

Fixed bug where soft bodies would collide with sensors as if they were normal bodies

Fixes #877
Jorrit Rouwe 1 năm trước cách đây
mục cha
commit
0f3597856e

+ 1 - 0
Docs/ReleaseNotes.md

@@ -25,6 +25,7 @@ For breaking API changes see [this document](https://github.com/jrouwe/JoltPhysi
 
 ### Bug fixes
 * Fixed bug in soft body vs tapered capsule. The calculations were slightly off causing a normal on the top or bottom sphere to be returned while the tapered part was actually closest.
+* Fixed bug where soft bodies would collide with sensors as if they were normal bodies.
 * Sensors will no longer use speculative contacts, so will no longer report contacts before an actual contact is detected.
 * Hinge limit constraint forces were clamped wrongly when the hinge was exactly at the minimum limit, making it harder to push the hinge towards the maximum limit.
 * Fixed bug when a body with limited DOFs collides with static. If the resulting contact had an infinite effective mass, we would divide by zero and crash.

+ 1 - 0
Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp

@@ -113,6 +113,7 @@ void SoftBodyMotionProperties::DetermineCollidingShapes(const SoftBodyUpdateCont
 			{
 				const Body &body = lock.GetBody();
 				if (body.IsRigidBody() // TODO: We should support soft body vs soft body
+					&& !body.IsSensor()
 					&& mSoftBody.GetCollisionGroup().CanCollide(body.GetCollisionGroup()))
 				{
 					CollidingShape cs;