Add AABBBlock#overlaps methods

This commit is contained in:
Marc Baloup 2022-05-09 19:02:13 +02:00
parent ca8e244dae
commit 68a1ea7534
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -56,6 +56,13 @@ public class AABBBlock implements Iterable<BlockVector> {
volume = Math.abs(p2x_ - p1x_) * Math.abs(p2x_ - p1x_) * Math.abs(p2x_ - p1x_); volume = Math.abs(p2x_ - p1x_) * Math.abs(p2x_ - p1x_) * Math.abs(p2x_ - p1x_);
} }
public boolean overlaps(Entity e) {
return overlaps(e.getBoundingBox());
}
public boolean overlaps(BoundingBox bb) {
return asBukkitBoundingBox().overlaps(bb);
}
public boolean isInside(Vector v) { public boolean isInside(Vector v) {
return v.isInAABB(pos1, pos2); return v.isInAABB(pos1, pos2);