1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Improve belt direction lock

This commit is contained in:
tobspr
2020-06-17 13:21:34 +02:00
parent 84969a9205
commit a95e69401d
3 changed files with 18 additions and 20 deletions

View File

@@ -978,17 +978,3 @@ export function formatItemsPerSecond(speed, double = false) {
: T.ingame.buildingPlacement.infoTexts.itemsPerSecond.replace("<x>", "" + round2Digits(speed)) +
(double ? " " + T.ingame.buildingPlacement.infoTexts.itemsPerSecondDouble : "");
}
/**
* Finds the corner point between two vectors
* @param {Vector} a
* @param {Vector} b
*/
export function findCornerBetweenPoints(a, b) {
const delta = b.sub(a);
if (Math_abs(delta.x) > Math_abs(delta.y)) {
return new Vector(a.x, b.y);
} else {
return new Vector(b.x, a.y);
}
}