列车方向调整
This commit is contained in:
parent
07174d8fc8
commit
c89f7bde68
@ -419,7 +419,7 @@ export class Train extends JlGraphic {
|
|||||||
const py = startP.y + Math.round(offset * (endP.y - startP.y));
|
const py = startP.y + Math.round(offset * (endP.y - startP.y));
|
||||||
let angle = Math.atan2(endP.y - startP.y, endP.x - startP.x);
|
let angle = Math.atan2(endP.y - startP.y, endP.x - startP.x);
|
||||||
if (-Math.PI / 2 > angle) {
|
if (-Math.PI / 2 > angle) {
|
||||||
angle = angle + Math.PI;
|
angle = -(angle + Math.PI);
|
||||||
}
|
}
|
||||||
if (Math.PI / 2 <= angle) {
|
if (Math.PI / 2 <= angle) {
|
||||||
angle = angle - Math.PI;
|
angle = angle - Math.PI;
|
||||||
|
Loading…
Reference in New Issue
Block a user