summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-14 20:44:19 +0100
committerGitHub <noreply@github.com>2021-01-14 20:44:19 +0100
commit011d201046d3957e5232435fd560f803798c26f9 (patch)
tree048cc13805fe1e9aeb55b2fd0586b28ee2e77a6b /modules
parente3b523a0887be350626b46a08cee87e5b5b3b78b (diff)
parent356a2b72353ea8a0e7d3319834ff1de689d8f94c (diff)
Merge pull request #43923 from madmiraal/fix-43588
Fix cast_motion sometimes failing
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/space_bullet.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index 5cbaeb32d7..d7dd11d2a5 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -177,8 +177,10 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf
bt_xform_to.getOrigin() += bt_motion;
if ((bt_xform_to.getOrigin() - bt_xform_from.getOrigin()).fuzzyZero()) {
+ r_closest_safe = 1.0f;
+ r_closest_unsafe = 1.0f;
bulletdelete(btShape);
- return false;
+ return true;
}
GodotClosestConvexResultCallback btResult(bt_xform_from.getOrigin(), bt_xform_to.getOrigin(), &p_exclude, p_collide_with_bodies, p_collide_with_areas);