mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-25 13:39:06 -05:00
revert engine collisionStart event back to before resolve
This commit is contained in:
parent
b81d6e6d7f
commit
4443e6dd99
1 changed files with 4 additions and 3 deletions
|
@ -146,6 +146,10 @@ var Body = require('../body/Body');
|
||||||
if (engine.enableSleeping)
|
if (engine.enableSleeping)
|
||||||
Sleeping.afterCollisions(pairs.list);
|
Sleeping.afterCollisions(pairs.list);
|
||||||
|
|
||||||
|
// trigger collision events
|
||||||
|
if (pairs.collisionStart.length > 0)
|
||||||
|
Events.trigger(engine, 'collisionStart', { pairs: pairs.collisionStart });
|
||||||
|
|
||||||
// iteratively resolve position between collisions
|
// iteratively resolve position between collisions
|
||||||
var positionDamping = Common.clamp(20 / engine.positionIterations, 0, 1);
|
var positionDamping = Common.clamp(20 / engine.positionIterations, 0, 1);
|
||||||
|
|
||||||
|
@ -172,9 +176,6 @@ var Body = require('../body/Body');
|
||||||
Engine._bodiesUpdateVelocities(allBodies);
|
Engine._bodiesUpdateVelocities(allBodies);
|
||||||
|
|
||||||
// trigger collision events
|
// trigger collision events
|
||||||
if (pairs.collisionStart.length > 0)
|
|
||||||
Events.trigger(engine, 'collisionStart', { pairs: pairs.collisionStart });
|
|
||||||
|
|
||||||
if (pairs.collisionActive.length > 0)
|
if (pairs.collisionActive.length > 0)
|
||||||
Events.trigger(engine, 'collisionActive', { pairs: pairs.collisionActive });
|
Events.trigger(engine, 'collisionActive', { pairs: pairs.collisionActive });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue