refactor: make Tile::getTileAABB return AABB

This commit is contained in:
orng
2026-03-28 00:30:07 -05:00
parent 7158fd398f
commit ddfe9b3d48
21 changed files with 25 additions and 26 deletions

View File

@@ -42,12 +42,12 @@ std::optional<AABB> CakeTile::getAABB(Level* level, int x, int y, int z) {
return AABB{x + r2, static_cast<double>(y), z + r, x + 1 - r, y + h - r, z + 1 - r};
}
AABB* CakeTile::getTileAABB(Level* level, int x, int y, int z) {
AABB CakeTile::getTileAABB(Level* level, int x, int y, int z) {
int d = level->getData(x, y, z);
float r = 1 / 16.0f;
float r2 = (1 + d * 2) / 16.0f;
float h = 8 / 16.0f;
return AABB::newTemp(x + r2, y, z + r, x + 1 - r, y + h, z + 1 - r);
return AABB(x + r2, y, z + r, x + 1 - r, y + h, z + 1 - r);
}
Icon* CakeTile::getTexture(int face, int data) {