mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -05:00
optimised Resolver.solvePosition
This commit is contained in:
parent
52e797791b
commit
f847f4c83e
1 changed files with 2 additions and 7 deletions
|
@ -73,15 +73,10 @@ var Bounds = require('../geometry/Bounds');
|
||||||
bodyB = collision.parentB;
|
bodyB = collision.parentB;
|
||||||
normal = collision.normal;
|
normal = collision.normal;
|
||||||
|
|
||||||
// TODO: behaviour change: replace with fully simplified version
|
|
||||||
// get current separation between body edges involved in collision
|
// get current separation between body edges involved in collision
|
||||||
pair.separation =
|
pair.separation =
|
||||||
normal.x * (
|
normal.x * (bodyB.positionImpulse.x + collision.penetration.x - bodyA.positionImpulse.x)
|
||||||
(bodyB.positionImpulse.x + bodyB.position.x) - (bodyA.positionImpulse.x + (bodyB.position.x - collision.penetration.x))
|
+ normal.y * (bodyB.positionImpulse.y + collision.penetration.y - bodyA.positionImpulse.y);
|
||||||
)
|
|
||||||
+ normal.y * (
|
|
||||||
(bodyB.positionImpulse.y + bodyB.position.y) - (bodyA.positionImpulse.y + (bodyB.position.y - collision.penetration.y))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < pairsLength; i++) {
|
for (i = 0; i < pairsLength; i++) {
|
||||||
|
|
Loading…
Reference in a new issue