Skip to content

Commit 329c926

Browse files
committed
GetOverlapX/Y now use the calculated delta values, not the deltaX/Y methods
1 parent 4ad7993 commit 329c926

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/physics/arcade/GetOverlapX.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ var GetOverlapX = function (body1, body2, overlapOnly, bias)
2222
var overlap = 0;
2323
var maxOverlap = body1.deltaAbsX() + body2.deltaAbsX() + bias;
2424

25-
if (body1.deltaX() === 0 && body2.deltaX() === 0)
25+
if (body1._dx === 0 && body2._dx === 0)
2626
{
2727
// They overlap but neither of them are moving
2828
body1.embedded = true;
2929
body2.embedded = true;
3030
}
31-
else if (body1.deltaX() > body2.deltaX())
31+
else if (body1._dx > body2._dx)
3232
{
3333
// Body1 is moving right and / or Body2 is moving left
3434
overlap = body1.right - body2.x;
@@ -45,7 +45,7 @@ var GetOverlapX = function (body1, body2, overlapOnly, bias)
4545
body2.touching.left = true;
4646
}
4747
}
48-
else if (body1.deltaX() < body2.deltaX())
48+
else if (body1._dx < body2._dx)
4949
{
5050
// Body1 is moving left and/or Body2 is moving right
5151
overlap = body1.x - body2.width - body2.x;

src/physics/arcade/GetOverlapY.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ var GetOverlapY = function (body1, body2, overlapOnly, bias)
2222
var overlap = 0;
2323
var maxOverlap = body1.deltaAbsY() + body2.deltaAbsY() + bias;
2424

25-
if (body1.deltaY() === 0 && body2.deltaY() === 0)
25+
if (body1._dy === 0 && body2._dy === 0)
2626
{
2727
// They overlap but neither of them are moving
2828
body1.embedded = true;
2929
body2.embedded = true;
3030
}
31-
else if (body1.deltaY() > body2.deltaY())
31+
else if (body1._dy > body2._dy)
3232
{
3333
// Body1 is moving down and/or Body2 is moving up
3434
overlap = body1.bottom - body2.y;
@@ -45,7 +45,7 @@ var GetOverlapY = function (body1, body2, overlapOnly, bias)
4545
body2.touching.up = true;
4646
}
4747
}
48-
else if (body1.deltaY() < body2.deltaY())
48+
else if (body1._dy < body2._dy)
4949
{
5050
// Body1 is moving up and/or Body2 is moving down
5151
overlap = body1.y - body2.bottom;

0 commit comments

Comments
 (0)