mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
fix issue with removed bodies causing collisions
This commit is contained in:
parent
cec294d9c3
commit
23a773ae88
1 changed files with 5 additions and 4 deletions
|
@ -160,6 +160,11 @@ var Body = require('../body/Body');
|
|||
broadphasePairs = allBodies;
|
||||
}
|
||||
|
||||
// clear all composite modified flags
|
||||
if (world.isModified) {
|
||||
Composite.setModified(world, false, false, true);
|
||||
}
|
||||
|
||||
// narrowphase pass: find actual collisions, then create or update collision pairs
|
||||
var collisions = broadphase.detector(broadphasePairs, engine);
|
||||
|
||||
|
@ -205,10 +210,6 @@ var Body = require('../body/Body');
|
|||
// clear force buffers
|
||||
_bodiesClearForces(allBodies);
|
||||
|
||||
// clear all composite modified flags
|
||||
if (world.isModified)
|
||||
Composite.setModified(world, false, false, true);
|
||||
|
||||
Events.trigger(engine, 'afterUpdate', event);
|
||||
|
||||
return engine;
|
||||
|
|
Loading…
Reference in a new issue