Browse Source

Check that motion is not zero before doing a sweep test.

Fixes #25476.
Marcel Admiraal 5 years ago
parent
commit
78055cbdaf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/bullet/space_bullet.cpp

+ 2 - 2
modules/bullet/space_bullet.cpp

@@ -945,8 +945,8 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
 
 
 	btVector3 motion;
 	btVector3 motion;
 	G_TO_B(p_motion, motion);
 	G_TO_B(p_motion, motion);
-
-	{ /// phase two - sweep test, from a secure position without margin
+	if (!motion.fuzzyZero()) {
+		// Phase two - sweep test, from a secure position without margin
 
 
 		const int shape_count(p_body->get_shape_count());
 		const int shape_count(p_body->get_shape_count());