Browse Source

Merge pull request #26090 from aqnuep/ray_shape_fix2

Fix RayShape collision jitter when used with a RigidBody
Rémi Verschelde 6 years ago
parent
commit
6d0ec870e3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/bullet/godot_ray_world_algorithm.cpp

+ 2 - 2
modules/bullet/godot_ray_world_algorithm.cpp

@@ -100,8 +100,8 @@ void GodotRayWorldAlgorithm::processCollision(const btCollisionObjectWrapper *bo
 
 		btScalar depth(ray_shape->getScaledLength() * (btResult.m_closestHitFraction - 1));
 
-		if (depth >= -ray_shape->getMargin())
-			depth *= 0.5;
+		if (depth >= -ray_shape->getMargin() * 0.5)
+			depth = 0;
 
 		if (ray_shape->getSlipsOnSlope())
 			resultOut->addContactPoint(btResult.m_hitNormalWorld, btResult.m_hitPointWorld, depth);