fix(Core/Grids): Standardize grid coordinates (#21479)

This commit is contained in:
Takenbacon
2025-02-17 22:16:36 -08:00
committed by GitHub
parent 8207d1e8d0
commit 58d13e69e1
7 changed files with 30 additions and 59 deletions
+4 -2
View File
@@ -47,8 +47,8 @@ inline CellArea Cell::CalculateCellArea(float x, float y, float radius)
return CellArea(center, center);
}
CellCoord centerX = Acore::ComputeCellCoord(x - radius, y - radius).normalize();
CellCoord centerY = Acore::ComputeCellCoord(x + radius, y + radius).normalize();
CellCoord centerX = Acore::ComputeCellCoord(x + radius, y + radius).normalize();
CellCoord centerY = Acore::ComputeCellCoord(x - radius, y - radius).normalize();
return CellArea(centerX, centerY);
}
@@ -99,6 +99,8 @@ inline void Cell::Visit(CellCoord const& standing_cell, TypeContainerVisitor<T,
}
// loop the cell range
ASSERT(area.high_bound.x_coord >= area.low_bound.x_coord);
ASSERT(area.high_bound.y_coord >= area.low_bound.y_coord);
for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x)
{
for (uint32 y = area.low_bound.y_coord; y <= area.high_bound.y_coord; ++y)