diff options
Diffstat (limited to 'modules/bullet/godot_ray_world_algorithm.cpp')
-rw-r--r-- | modules/bullet/godot_ray_world_algorithm.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/bullet/godot_ray_world_algorithm.cpp b/modules/bullet/godot_ray_world_algorithm.cpp index 449f625e17..cadc8dd59e 100644 --- a/modules/bullet/godot_ray_world_algorithm.cpp +++ b/modules/bullet/godot_ray_world_algorithm.cpp @@ -35,8 +35,6 @@ #include <BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h> -#define RAY_STABILITY_MARGIN 0.1 - /** @author AndreaCatania */ @@ -102,8 +100,8 @@ void GodotRayWorldAlgorithm::processCollision(const btCollisionObjectWrapper *bo btScalar depth(ray_shape->getScaledLength() * (btResult.m_closestHitFraction - 1)); - if (depth >= -RAY_STABILITY_MARGIN) - depth = 0; + if (depth >= -ray_shape->getMargin()) + depth *= 0.5; if (ray_shape->getSlipsOnSlope()) resultOut->addContactPoint(btResult.m_hitNormalWorld, btResult.m_hitPointWorld, depth); |