| 16 | private final AABB aabb; |
| 17 | |
| 18 | public Selection(BetterBlockPos pos1, BetterBlockPos pos2) { |
| 19 | this.pos1 = pos1; |
| 20 | this.pos2 = pos2; |
| 21 | |
| 22 | this.min = new BetterBlockPos( |
| 23 | Math.min(pos1.x, pos2.x), |
| 24 | Math.min(pos1.y, pos2.y), |
| 25 | Math.min(pos1.z, pos2.z) |
| 26 | ); |
| 27 | |
| 28 | this.max = new BetterBlockPos( |
| 29 | Math.max(pos1.x, pos2.x), |
| 30 | Math.max(pos1.y, pos2.y), |
| 31 | Math.max(pos1.z, pos2.z) |
| 32 | ); |
| 33 | |
| 34 | this.size = new Vec3i( |
| 35 | max.x - min.x + 1, |
| 36 | max.y - min.y + 1, |
| 37 | max.z - min.z + 1 |
| 38 | ); |
| 39 | |
| 40 | this.aabb = new AABB(min.x, min.y, min.z, max.x + 1, max.y + 1, max.z + 1); |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public BetterBlockPos pos1() { |