Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Source/SharpNav/Heightfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public Heightfield(BBox3 b, float cellSize, float cellHeight)
this.bounds = b;

//make sure the bbox contains all the possible voxels.
width = (int)Math.Ceiling((b.Max.X - b.Min.X) / cellSize);
height = (int)Math.Ceiling((b.Max.Y - b.Min.Y) / cellHeight);
length = (int)Math.Ceiling((b.Max.Z - b.Min.Z) / cellSize);
width = (int)Math.Round((b.Max.X - b.Min.X) / cellSize);
height = (int)Math.Round((b.Max.Y - b.Min.Y) / cellHeight);
length = (int)Math.Round((b.Max.Z - b.Min.Z) / cellSize);

bounds.Max.X = bounds.Min.X + width * cellSize;
bounds.Max.Y = bounds.Min.Y + height * cellHeight;
Expand Down
2 changes: 1 addition & 1 deletion Source/SharpNav/PolyMeshDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ private void BuildPolyDetail(Vector3[] polyMeshVerts, int numMeshVerts, float sa
//tessellate outlines
if (sampleDist > 0)
{
for (int i = 0, j = verts.Count - 1; i < verts.Count; j = i++)
for (int i = 0, j = numMeshVerts - 1; i < numMeshVerts; j = i++)
{
Vector3 vi = verts[i];
Vector3 vj = verts[j];
Expand Down