Skip to content

Commit

Permalink
Add check for zero length motion at beginning of each sweep test loop
Browse files Browse the repository at this point in the history
in SpaceBullet::test_body_motion.
  • Loading branch information
madmiraal committed Dec 10, 2019
1 parent 16fc023 commit e0d2523
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 e0d2523

Please sign in to comment.