mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-14 10:41:52 +00:00
Fix Vector#equalsEpsilon ignoring parameter
Provided epsilon parameter was used for Y axis but ignored for X axis. Some useless return statements are also removed.
This commit is contained in:
parent
67f7babd09
commit
ad6e3c3b92
@ -489,7 +489,6 @@ export class Vector {
|
|||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
assertAlways(false, "Invalid fast inplace rotation: " + angle);
|
assertAlways(false, "Invalid fast inplace rotation: " + angle);
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// return new Vector(this.x * cos - this.y * sin, this.x * sin + this.y * cos);
|
// return new Vector(this.x * cos - this.y * sin, this.x * sin + this.y * cos);
|
||||||
@ -519,7 +518,6 @@ export class Vector {
|
|||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
assertAlways(false, "Invalid fast inplace rotation: " + angle);
|
assertAlways(false, "Invalid fast inplace rotation: " + angle);
|
||||||
return new Vector();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -593,7 +591,6 @@ export class Vector {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
assertAlways(false, "Invalid angle: " + angle);
|
assertAlways(false, "Invalid angle: " + angle);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,7 +600,7 @@ export class Vector {
|
|||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
equalsEpsilon(v, epsilon = 1e-5) {
|
equalsEpsilon(v, epsilon = 1e-5) {
|
||||||
return Math.abs(this.x - v.x) < 1e-5 && Math.abs(this.y - v.y) < epsilon;
|
return Math.abs(this.x - v.x) < epsilon && Math.abs(this.y - v.y) < epsilon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user