Skip to content

Commit

Permalink
Merge pull request #34225 from madmiraal/fix-34210
Browse files Browse the repository at this point in the history
Add check for zero length motion at beginning of each sweep test loop in SpaceBullet::test_body_motion
  • Loading branch information
akien-mga authored Jan 11, 2020
2 parents 0ab1726 + e0d2523 commit 0b18527
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/bullet/space_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f

btVector3 motion;
G_TO_B(p_motion, motion);
if (!motion.fuzzyZero()) {
{
// Phase two - sweep test, from a secure position without margin

const int shape_count(p_body->get_shape_count());
Expand All @@ -960,7 +960,7 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
motionVec->end();
#endif

for (int shIndex = 0; shIndex < shape_count; ++shIndex) {
for (int shIndex = 0; shIndex < shape_count && !motion.fuzzyZero(); ++shIndex) {
if (p_body->is_shape_disabled(shIndex)) {
continue;
}
Expand Down

0 comments on commit 0b18527

Please sign in to comment.