Skip to content

Commit

Permalink
bins error
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrabbers committed Jun 19, 2024
1 parent e796a03 commit a6fef47
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions BnbnavNetClient/Models/MapBin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public void Insert(Edge edge)
var maxY = int.Max(edge.From.Z, edge.To.Z);
var edgeBounds = new IntRect(minX, minY, maxX, maxY);
var expanded = edgeBounds.Expand(5);
var startX = (expanded.Left - Bounds.Left - BinSideLength / 2) / BinSideLength;
var startY = (expanded.Top - Bounds.Top - BinSideLength / 2) / BinSideLength;
var endX = (expanded.Right - Bounds.Left + BinSideLength / 2) / BinSideLength;
var endY = (expanded.Bottom - Bounds.Top + BinSideLength / 2) / BinSideLength;
var startX = (expanded.Left - Bounds.Left) / BinSideLength;
var startY = (expanded.Top - Bounds.Top) / BinSideLength;
var endX = (expanded.Right - Bounds.Left) / BinSideLength;
var endY = (expanded.Bottom - Bounds.Top) / BinSideLength;

for (var i = startX; i <= endX; i++)
{
Expand All @@ -81,10 +81,10 @@ public void Insert(Edge edge)
public void Query(IntRect rect, List<Node> nodes, List<Edge> edges)
{
rect = rect.Intersect(Bounds);
var startX = (rect.Left - Bounds.Left - BinSideLength / 2) / BinSideLength;
var startY = (rect.Top - Bounds.Top - BinSideLength / 2) / BinSideLength;
var endX = (rect.Right - Bounds.Left + BinSideLength / 2) / BinSideLength;
var endY = (rect.Bottom - Bounds.Top + BinSideLength / 2) / BinSideLength;
var startX = (rect.Left - Bounds.Left) / BinSideLength;
var startY = (rect.Top - Bounds.Top) / BinSideLength;
var endX = (rect.Right - Bounds.Left) / BinSideLength;
var endY = (rect.Bottom - Bounds.Top) / BinSideLength;

for (var i = startX; i <= endX; i++)
{
Expand Down

0 comments on commit a6fef47

Please sign in to comment.