Skip to content

Commit

Permalink
Fix navmesh bitmap size calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Oct 9, 2024
1 parent 419c52a commit 535eccb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vnavmesh/NavmeshBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public NavmeshBitmap(Vector3 min, Vector3 max, float pixelSize)
Resolution = 1.0f / pixelSize;
MinBounds = (min * Resolution).Floor() * PixelSize;
MaxBounds = (max * Resolution).Ceiling() * PixelSize;
Width = (int)((max.X - min.X) * Resolution);
Height = (int)((max.Z - min.Z) * Resolution);
Width = (int)((MaxBounds.X - MinBounds.X) * Resolution);
Height = (int)((MaxBounds.Z - MinBounds.Z) * Resolution);
BytesPerRow = (Width + 31) >> 5 << 2;
Pixels = new byte[Height * BytesPerRow];
Array.Fill(Pixels, (byte)0xFF);
Expand Down

0 comments on commit 535eccb

Please sign in to comment.