mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-10 00:06:42 -04:00
Fix the out-of-bounds check in grid broadphase
`world.bounds` is a normal bounds object with min and max coordinates instead of height and width.
This commit is contained in:
parent
a5b535d529
commit
a20a9fbd1c
1 changed files with 2 additions and 2 deletions
|
@ -62,8 +62,8 @@ var Common = require('../core/Common');
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// don't update out of world bodies
|
// don't update out of world bodies
|
||||||
if (body.bounds.max.x < 0 || body.bounds.min.x > world.bounds.width
|
if (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x
|
||||||
|| body.bounds.max.y < 0 || body.bounds.min.y > world.bounds.height)
|
|| body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var newRegion = _getRegion(grid, body);
|
var newRegion = _getRegion(grid, body);
|
||||||
|
|
Loading…
Add table
Reference in a new issue