Recti can return corner Vec2i now

This commit is contained in:
Dani The Skunk 2022-09-14 18:39:00 +02:00
parent fd46e3196c
commit a5c48c2ef2
1 changed files with 16 additions and 0 deletions

View File

@ -36,4 +36,20 @@ public final class Recti {
public int getHeight() {
return size.getY();
}
public Vec2i getTopLeft() {
return pos;
}
public Vec2i getTopRight() {
return new Vec2i(pos.getX() + size.getX(), pos.getY());
}
public Vec2i getBottomLeft() {
return new Vec2i(pos.getX(), pos.getY() + size.getY());
}
public Vec2i getBottomRight() {
return Vec2i.add(pos, size);
}
}