Skip to content

Commit 89963f7

Browse files
committed
optimised Resolver.solvePosition
1 parent c265626 commit 89963f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/collision/Resolver.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ var Bounds = require('../geometry/Bounds');
7979

8080
// get current separation between body edges involved in collision
8181
pair.separation =
82-
normal.x * (bodyB.positionImpulse.x + collision.penetration.x - bodyA.positionImpulse.x)
83-
+ normal.y * (bodyB.positionImpulse.y + collision.penetration.y - bodyA.positionImpulse.y);
82+
collision.depth + normal.x * (bodyB.positionImpulse.x - bodyA.positionImpulse.x)
83+
+ normal.y * (bodyB.positionImpulse.y - bodyA.positionImpulse.y);
8484
}
8585

8686
for (i = 0; i < pairsLength; i++) {

0 commit comments

Comments
 (0)