0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-12 16:08:50 -05:00

removed Collision._projectToAxis

This commit is contained in:
liabru 2023-07-23 11:22:59 +01:00
parent 653a110d64
commit 4c56e5b11d

View file

@ -153,7 +153,7 @@ var Pair = require('./Pair');
}
// update supports array size
supports.length = supportCount;
supports.length = supportCount;
return collision;
};
@ -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