Skip to content

Commit 5589374

Browse files
committed
Removed debugging
1 parent 1478100 commit 5589374

4 files changed

Lines changed: 20 additions & 56 deletions

File tree

src/physics/arcade/GetOverlap.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,17 @@ var GetOverlap = function (body1, body2, overlapOnly, bias)
2727

2828
var collisionInfo = CollisionInfo.get(body1, body2, overlapOnly, bias);
2929

30+
// console.log('');
31+
// console.log('%c GetOverlap ' + body1.world._frame + ' ', 'background-color: aqua');
32+
// collisionInfo.dump();
33+
3034
if (overlapOnly || collisionInfo.embedded)
3135
{
3236
return collisionInfo;
3337
}
3438

35-
console.log('');
36-
console.log('%c GetOverlap ' + body1.world._frame + ' ', 'background-color: aqua');
37-
collisionInfo.dump();
38-
3939
if (collisionInfo.face === CONST.FACING_LEFT)
4040
{
41-
// console.log('GetOverlap leftFace');
42-
4341
if (collisionInfo.body1 === body1)
4442
{
4543
body1.setTouchingLeft();
@@ -56,8 +54,6 @@ var GetOverlap = function (body1, body2, overlapOnly, bias)
5654
}
5755
else if (collisionInfo.face === CONST.FACING_RIGHT)
5856
{
59-
// console.log('GetOverlap rightFace');
60-
6157
if (collisionInfo.body1 === body1)
6258
{
6359
body1.setTouchingRight();
@@ -74,8 +70,6 @@ var GetOverlap = function (body1, body2, overlapOnly, bias)
7470
}
7571
else if (collisionInfo.face === CONST.FACING_UP)
7672
{
77-
// console.log('GetOverlap topFace');
78-
7973
if (collisionInfo.body1 === body1)
8074
{
8175
body1.setTouchingUp();
@@ -92,8 +86,6 @@ var GetOverlap = function (body1, body2, overlapOnly, bias)
9286
}
9387
else if (collisionInfo.face === CONST.FACING_DOWN)
9488
{
95-
// console.log('GetOverlap bottomFace');
96-
9789
if (collisionInfo.body1 === body1)
9890
{
9991
body1.setTouchingDown();

src/physics/arcade/SeparateX.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ var SeparateX = function (collisionInfo)
113113
nx1 = avg + nv1 * bounce1.x;
114114
nx2 = avg + nv2 * bounce2.x;
115115

116-
// console.log('resolution 1');
116+
// console.log('resolution 1x');
117117
// console.log('pre-impact v = body1', x1, 'body2', x2);
118118
// console.log('post-impact v = body1', nx1, 'body2', nx2);
119119
// console.log('pre-impact x = body1', body1.gameObject.x, 'body2', body2.gameObject.x);
@@ -128,16 +128,9 @@ var SeparateX = function (collisionInfo)
128128
{
129129
// Body1 is immovable, so adjust body2 speed
130130

131-
if (body1.rideable)
132-
{
133-
nx2 = (leftFace) ? 1 : -1;
134-
}
135-
else
136-
{
137-
nx2 = x1 - x2 * bounce2.x;
138-
}
131+
nx2 = x1 - x2 * bounce2.x;
139132

140-
// console.log('%cresolution 2', 'background-color: red; color: white');
133+
// console.log('%cresolution 2x', 'background-color: red; color: white');
141134
// console.log('pre-impact v = body1', x1, 'body2', x2);
142135
// console.log('post-impact v = body1', nx1, 'body2', nx2);
143136
// console.log('pre-impact by = body1', body1.y, 'body2', body2.y);
@@ -149,16 +142,9 @@ var SeparateX = function (collisionInfo)
149142
{
150143
// Body2 is immovable, so adjust body1 speed
151144

152-
if (body2.rideable)
153-
{
154-
nx1 = (leftFace) ? 1 : -1;
155-
}
156-
else
157-
{
158-
nx1 = x2 - x1 * bounce1.x;
159-
}
145+
nx1 = x2 - x1 * bounce1.x;
160146

161-
// console.log('resolution 4');
147+
// console.log('resolution 3x');
162148
// console.log('pre-impact v = body1', x1, 'body2', x2);
163149
// console.log('post-impact v = body1', nx1, 'body2', nx2);
164150
// console.log('pre-impact y = body1', body1.gameObject.y, 'body2', body2.gameObject.y);
@@ -167,9 +153,9 @@ var SeparateX = function (collisionInfo)
167153
}
168154
else
169155
{
170-
// console.log('neither moving, or both immovable');
156+
// console.log('neither moving, or both immovable x');
171157

172-
// console.log('resolution 5');
158+
// console.log('resolution 4x');
173159
// console.log('pre-impact v = body1', x1, 'body2', x2);
174160
// console.log('post-impact v = body1', nx1, 'body2', nx2);
175161
// console.log('sleeping? = body1', body1.sleeping, 'body2', body2.sleeping);

src/physics/arcade/SeparateY.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var SeparateY = function (collisionInfo)
114114
ny1 = avg + nv1 * bounce1.y;
115115
ny2 = avg + nv2 * bounce2.y;
116116

117-
// console.log('resolution 1');
117+
// console.log('resolution 1y');
118118
// console.log('pre-impact v = body1', v1, 'body2', v2);
119119
// console.log('post-impact v = body1', ny1, 'body2', ny2);
120120
// console.log('pre-impact y = body1', body1.gameObject.y, 'body2', body2.gameObject.y);
@@ -129,16 +129,9 @@ var SeparateY = function (collisionInfo)
129129
{
130130
// Body1 is immovable, so adjust body2 speed
131131

132-
if (body1.rideable)
133-
{
134-
ny2 = (topFace) ? 1 : -1;
135-
}
136-
else
137-
{
138-
ny2 = v1 - v2 * bounce2.y;
139-
}
132+
ny2 = v1 - v2 * bounce2.y;
140133

141-
// console.log('%cresolution 3', 'background-color: red; color: white');
134+
// console.log('%cresolution 2y', 'background-color: red; color: white');
142135
// console.log('pre-impact v = body1', v1, 'body2', v2);
143136
// console.log('post-impact v = body1', ny1, 'body2', ny2);
144137
// console.log('pre-impact by = body1', body1.y, 'body2', body2.y);
@@ -150,16 +143,9 @@ var SeparateY = function (collisionInfo)
150143
{
151144
// Body2 is immovable, so adjust body1 speed
152145

153-
if (body2.rideable)
154-
{
155-
ny1 = (topFace) ? 1 : -1;
156-
}
157-
else
158-
{
159-
ny1 = v2 - v1 * bounce1.y;
160-
}
146+
ny1 = v2 - v1 * bounce1.y;
161147

162-
// console.log('%cresolution 4', 'background-color: red; color: white');
148+
// console.log('%cresolution 3y', 'background-color: red; color: white');
163149
// console.log('pre-impact v = body1', v1, 'body2', v2);
164150
// console.log('post-impact v = body1', ny1, 'body2', ny2);
165151
// console.log('pre-impact y = body1', body1.gameObject.y, 'body2', body2.gameObject.y);
@@ -170,7 +156,7 @@ var SeparateY = function (collisionInfo)
170156
{
171157
// console.log('neither moving, or both immovable');
172158

173-
// console.log('resolution 5');
159+
// console.log('resolution 4y');
174160
// console.log('pre-impact v = body1', v1, 'body2', v2);
175161
// console.log('post-impact v = body1', ny1, 'body2', ny2);
176162
// console.log('sleeping? = body1', body1.sleeping, 'body2', body2.sleeping);

src/physics/arcade/World.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,9 +1396,6 @@ var World = new Class({
13961396

13971397
if (collisionInfo.intersects)
13981398
{
1399-
// console.log('%c Separate ' + this._frame + ' ', 'background-color: yellow');
1400-
// collisionInfo.dump();
1401-
14021399
if (collisionInfo.forceX)
14031400
{
14041401
SeparateX(collisionInfo);
@@ -1408,6 +1405,9 @@ var World = new Class({
14081405
SeparateY(collisionInfo);
14091406
}
14101407

1408+
// console.log('%c Separate ' + this._frame + ' ', 'background-color: yellow');
1409+
// collisionInfo.dump();
1410+
14111411
if (overlapOnly)
14121412
{
14131413
if (body1.onOverlap || body2.onOverlap)

0 commit comments

Comments
 (0)