Fixed the issue with the line connecting the first two points of the SquadCombat.

This commit is contained in:
ethan 2023-09-04 10:01:17 +08:00
parent ebcd177bf5
commit 79c9e449fc

View File

@ -22,6 +22,18 @@ export default class SquadCombat extends AttackArrow {
this.tailWidthFactor = 0.1; this.tailWidthFactor = 0.1;
} }
/**
* Add points only on click events
*/
addPoint(cartesian: Cartesian3) {
this.points.push(cartesian);
if (this.points.length < 2) {
this.onMouseMove();
} else if (this.points.length > 2) {
this.lineEntity && this.viewer.entities.remove(this.lineEntity);
}
}
/** /**
* Draw a shape based on mouse movement points during the initial drawing. * Draw a shape based on mouse movement points during the initial drawing.
*/ */