(x1, y1, x2, y2)
| 14 | |
| 15 | class Line { |
| 16 | constructor(x1, y1, x2, y2) { |
| 17 | this.x1 = x1; |
| 18 | this.x2 = x2; |
| 19 | this.y1 = y1; |
| 20 | this.y2 = y2; |
| 21 | this.isHorizontal = y1 === y2; |
| 22 | this.isVertical = x1 === x2; |
| 23 | |
| 24 | |
| 25 | this.isDiagonal = !(this.isHorizontal || this.isVertical) |
| 26 | this.ensurePointsAreInOrder(); |
| 27 | |
| 28 | |
| 29 | this.midPoint = createVector((x1+x2)/2,(y1+y2)/2); |
| 30 | |
| 31 | |
| 32 | this.diagonalCollisionInfo = new DiagonalCollisionInfo(); |
| 33 | |
| 34 | } |
| 35 | |
| 36 | |
| 37 | Show() { |
nothing calls this directly
no test coverage detected