Skip to content

Commit bfdd039

Browse files
committed
Don't force body position at this point
1 parent 290ef21 commit bfdd039

1 file changed

Lines changed: 4 additions & 33 deletions

File tree

src/physics/arcade/CheckOverlapY.js

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7-
// var CONST = require('./const');
87
var IntersectsRect = require('./IntersectsRect');
98

109
/**
@@ -26,18 +25,12 @@ var CheckOverlapY = function (body1, body2, padding)
2625
{
2726
if (padding === undefined) { padding = 0; }
2827

29-
// var body1Immovable = (body1.physicsType === CONST.STATIC_BODY || body1.immovable);
30-
// var body2Immovable = (body2.physicsType === CONST.STATIC_BODY || body2.immovable);
31-
3228
var distance1 = body1.bottom - body2.y;
3329
var distance2 = body2.bottom - body1.y;
3430

3531
var prevDistance1 = (body1.prev.y + body1.height) - body2.prev.y;
3632
var prevDistance2 = (body2.prev.y + body2.height) - body1.prev.y;
3733

38-
// var worldBlocked1 = body1.worldBlocked;
39-
// var worldBlocked2 = body2.worldBlocked;
40-
4134
var topFace = (distance1 > distance2 && prevDistance1 > prevDistance2);
4235

4336
var intersects = IntersectsRect(body1, body2, padding);
@@ -49,19 +42,8 @@ var CheckOverlapY = function (body1, body2, padding)
4942
body1.setTouchingDown();
5043
body2.setTouchingUp();
5144

52-
body1.setBlockedDown(body2);
53-
body2.setBlockedUp(body1);
54-
55-
// World blocks cannot be penetrated
56-
// if (worldBlocked2.down || body2Immovable)
57-
// {
58-
// body1.setWorldBlockedDown();
59-
// }
60-
61-
// if (worldBlocked1.up || body1Immovable)
62-
// {
63-
// body2.setWorldBlockedUp();
64-
// }
45+
body1.setBlockedDown(body2, false);
46+
body2.setBlockedUp(body1, false);
6547
}
6648
}
6749
else if (intersects && topFace)
@@ -71,19 +53,8 @@ var CheckOverlapY = function (body1, body2, padding)
7153
body1.setTouchingUp();
7254
body2.setTouchingDown();
7355

74-
body1.setBlockedUp(body2);
75-
body2.setBlockedDown(body1);
76-
77-
// World blocks cannot be penetrated
78-
// if (worldBlocked2.up || body2Immovable)
79-
// {
80-
// body1.setWorldBlockedUp();
81-
// }
82-
83-
// if (worldBlocked1.down || body1Immovable)
84-
// {
85-
// body2.setWorldBlockedDown();
86-
// }
56+
body1.setBlockedUp(body2, false);
57+
body2.setBlockedDown(body1, false);
8758
}
8859
}
8960

0 commit comments

Comments
 (0)