Skip to content

Commit

Permalink
removed Collision._projectToAxis
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jul 23, 2023
1 parent 653a110 commit 4c56e5b
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/collision/Collision.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ var Pair = require('./Pair');
}

// update supports array size
supports.length = supportCount;
supports.length = supportCount;

return collision;
};
Expand Down Expand Up @@ -232,32 +232,6 @@ var Pair = require('./Pair');
result.overlap = overlapMin;
};

/**
* Projects vertices on an axis and returns an interval.
* @method _projectToAxis
* @private
* @param {} projection
* @param {} vertices
* @param {} axis
*/
Collision._projectToAxis = function(projection, vertices, axis) {
var min = vertices[0].x * axis.x + vertices[0].y * axis.y,
max = min;

for (var i = 1; i < vertices.length; i += 1) {
var dot = vertices[i].x * axis.x + vertices[i].y * axis.y;

if (dot > max) {
max = dot;
} else if (dot < min) {
min = dot;
}
}

projection.min = min;
projection.max = max;
};

/**
* Finds supporting vertices given two bodies along a given direction using hill-climbing.
* @method _findSupports
Expand Down

0 comments on commit 4c56e5b

Please sign in to comment.