diff options
Diffstat (limited to 'modules/bullet/godot_ray_world_algorithm.cpp')
-rw-r--r-- | modules/bullet/godot_ray_world_algorithm.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/bullet/godot_ray_world_algorithm.cpp b/modules/bullet/godot_ray_world_algorithm.cpp index fbb336ca56..a84f3511ba 100644 --- a/modules/bullet/godot_ray_world_algorithm.cpp +++ b/modules/bullet/godot_ray_world_algorithm.cpp @@ -98,12 +98,13 @@ void GodotRayWorldAlgorithm::processCollision(const btCollisionObjectWrapper *bo if (btResult.hasHit()) { btScalar depth(ray_shape->getScaledLength() * (btResult.m_closestHitFraction - 1)); - if (depth > -RAY_PENETRATION_DEPTH_EPSILON) + if (depth > -RAY_PENETRATION_DEPTH_EPSILON) { depth = 0.0; + } - if (ray_shape->getSlipsOnSlope()) + if (ray_shape->getSlipsOnSlope()) { resultOut->addContactPoint(btResult.m_hitNormalWorld, btResult.m_hitPointWorld, depth); - else { + } else { resultOut->addContactPoint((ray_transform.getOrigin() - to.getOrigin()).normalize(), btResult.m_hitPointWorld, depth); } } |