Ability to get min and max of AABBBlock

This commit is contained in:
Marc Baloup 2023-08-14 02:10:59 +02:00
parent 0fcd02c80d
commit 45ab550d06

View File

@ -74,6 +74,22 @@ public class AABBBlock implements BlockSet, Cloneable {
return this; return this;
} }
public Vector getMin() {
return pos1.clone();
}
public Vector getMax() {
return pos2.clone();
}
public BlockVector getMinBlock() {
return pos1.toBlockVector();
}
public BlockVector getMaxBlock() {
return pos2.clone().add(new Vector(-1, -1, -1)).toBlockVector();
}
public AABBBlock shift(int x, int y, int z) { public AABBBlock shift(int x, int y, int z) {
return new AABBBlock(this, x, y, z); return new AABBBlock(this, x, y, z);
} }