Skip to content

Commit e83db95

Browse files
committed
Use ColInfo
1 parent 075e030 commit e83db95

1 file changed

Lines changed: 6 additions & 35 deletions

File tree

src/physics/arcade/World.js

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,51 +1387,22 @@ var World = new Class({
13871387
var collisionInfo = GetOverlap(body1, body2, overlapOnly, this.OVERLAP_BIAS);
13881388

13891389
// Do we separate on x or y first?
1390-
if (collisionInfo.overlapX < collisionInfo.overlapY)
1391-
{
1392-
resultX = SeparateX(collisionInfo);
13931390

1394-
// Are they still intersecting? Let's do the other axis then
1395-
if (this.intersects(body1, body2))
1396-
{
1397-
console.log('still intersects 1');
1398-
// resultY = SeparateY(collisionInfo);
1399-
}
1400-
}
1401-
else
1391+
if (collisionInfo.intersects)
14021392
{
1403-
resultY = SeparateY(collisionInfo);
1393+
console.log('');
1394+
console.log('%c World frame ' + body1.world._frame + ' ', 'background-color: orange');
1395+
collisionInfo.dump();
14041396

1405-
// Are they still intersecting? Let's do the other axis then
1406-
if (this.intersects(body1, body2))
1397+
if (collisionInfo.forceX)
14071398
{
1408-
console.log('still intersects 2');
14091399
resultX = SeparateX(collisionInfo);
14101400
}
1411-
}
1412-
1413-
/*
1414-
if (this.forceX || Math.abs(this.gravity.y + body1.gravity.y) < Math.abs(this.gravity.x + body1.gravity.x))
1415-
{
1416-
resultX = SeparateX(collisionInfo);
1417-
1418-
// Are they still intersecting? Let's do the other axis then
1419-
if (this.intersects(body1, body2))
1401+
else
14201402
{
14211403
resultY = SeparateY(collisionInfo);
14221404
}
14231405
}
1424-
else
1425-
{
1426-
resultY = SeparateY(collisionInfo);
1427-
1428-
// Are they still intersecting? Let's do the other axis then
1429-
if (this.intersects(body1, body2))
1430-
{
1431-
resultX = SeparateX(collisionInfo);
1432-
}
1433-
}
1434-
*/
14351406

14361407
var result = (resultX || resultY);
14371408

0 commit comments

Comments
 (0)