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:
parent
653a110d64
commit
4c56e5b11d
1 changed files with 1 additions and 27 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue