Skip to content

Commit

Permalink
Merge pull request #231 from Rantanen/patch-1
Browse files Browse the repository at this point in the history
Fix the out-of-bounds check in grid broadphase
  • Loading branch information
liabru committed Apr 5, 2016
2 parents a31ab39 + a20a9fb commit b6f6a03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/collision/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ var Common = require('../core/Common');
continue;

// don't update out of world bodies
if (body.bounds.max.x < 0 || body.bounds.min.x > world.bounds.width
|| body.bounds.max.y < 0 || body.bounds.min.y > world.bounds.height)
if (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x
|| body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y)
continue;

var newRegion = _getRegion(grid, body);
Expand Down

0 comments on commit b6f6a03

Please sign in to comment.