|
@@ -490,6 +490,9 @@ export default {
|
|
|
x: null,
|
|
|
y: null,
|
|
|
},
|
|
|
+ // 多久更新一次轨迹
|
|
|
+ updatePathFlag: 125,
|
|
|
+ cycleCount: 0, // 循环计数
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -706,6 +709,9 @@ export default {
|
|
|
dude.y = data.targetAircraft[0].aircrafts[i].coordinateY;
|
|
|
dude.rotation = Math.atan2(dude.y, dude.x) + Math.PI / 2;
|
|
|
|
|
|
+ // const rotation = Math.atan2(eastSpeed, northSpeed);
|
|
|
+ // dude.rotation = (-rotation + 2 * Math.PI) % (2 * Math.PI);
|
|
|
+
|
|
|
dude.id = data.targetAircraft[0].aircrafts[i].aircraftNumber; // 分配唯一编号
|
|
|
|
|
|
this.targetUavAry.push(dude);
|
|
@@ -823,9 +829,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 更新路径绘制
|
|
|
- this.updatePath();
|
|
|
-
|
|
|
+ if (this.cycleCount % this.updatePathFlag == 0) {
|
|
|
+ // 更新路径绘制
|
|
|
+ this.updatePath();
|
|
|
+ }
|
|
|
+ this.cycleCount++;
|
|
|
// 更新位置
|
|
|
//this.updatePosition();
|
|
|
},
|