diff --git a/src/arrow/squad-combat.ts b/src/arrow/squad-combat.ts index 984aa8c..1ea42f2 100644 --- a/src/arrow/squad-combat.ts +++ b/src/arrow/squad-combat.ts @@ -22,6 +22,18 @@ export default class SquadCombat extends AttackArrow { 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. */