Merge pull request #26090 from aqnuep/ray_shape_fix2

Fix RayShape collision jitter when used with a RigidBody
This commit is contained in:
Rémi Verschelde 2019-02-20 17:28:31 +01:00 committed by GitHub
commit 6d0ec870e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);