0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-25 13:39:06 -05:00

Merge pull request #231 from Rantanen/patch-1

Fix the out-of-bounds check in grid broadphase
This commit is contained in:
Liam 2016-04-05 20:43:29 +01:00
commit b6f6a03672

View file

@ -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);