diff --git a/src/DotRecast.Detour/Io/MeshDataReader.cs b/src/DotRecast.Detour/Io/MeshDataReader.cs index 8b7ee86..39563f0 100644 --- a/src/DotRecast.Detour/Io/MeshDataReader.cs +++ b/src/DotRecast.Detour/Io/MeshDataReader.cs @@ -91,15 +91,14 @@ namespace DotRecast.Detour.Io header.walkableHeight = buf.getFloat(); header.walkableRadius = buf.getFloat(); header.walkableClimb = buf.getFloat(); - for (int j = 0; j < 3; j++) - { - header.bmin[j] = buf.getFloat(); - } + + header.bmin.x = buf.getFloat(); + header.bmin.y = buf.getFloat(); + header.bmin.z = buf.getFloat(); - for (int j = 0; j < 3; j++) - { - header.bmax[j] = buf.getFloat(); - } + header.bmax.x = buf.getFloat(); + header.bmax.y = buf.getFloat(); + header.bmax.z = buf.getFloat(); header.bvQuantFactor = buf.getFloat(); data.verts = readVerts(buf, header.vertCount); diff --git a/src/DotRecast.Recast/RecastMesh.cs b/src/DotRecast.Recast/RecastMesh.cs index e0b6a9a..ef5bff8 100644 --- a/src/DotRecast.Recast/RecastMesh.cs +++ b/src/DotRecast.Recast/RecastMesh.cs @@ -1239,8 +1239,8 @@ namespace DotRecast.Recast int maxVertsPerMesh = 0; for (int i = 0; i < nmeshes; ++i) { - RecastVectors.min(ref mesh.bmin, meshes[i].bmin, 0); - RecastVectors.max(ref mesh.bmax, meshes[i].bmax, 0); + RecastVectors.min(ref mesh.bmin, meshes[i].bmin); + RecastVectors.max(ref mesh.bmax, meshes[i].bmax); maxVertsPerMesh = Math.Max(maxVertsPerMesh, meshes[i].nverts); maxVerts += meshes[i].nverts; maxPolys += meshes[i].npolys; diff --git a/src/DotRecast.Recast/RecastVectors.cs b/src/DotRecast.Recast/RecastVectors.cs index 637182a..1f714bb 100644 --- a/src/DotRecast.Recast/RecastVectors.cs +++ b/src/DotRecast.Recast/RecastVectors.cs @@ -32,11 +32,11 @@ namespace DotRecast.Recast a.z = Math.Min(a.z, b[i + 2]); } - public static void min(ref Vector3f a, Vector3f b, int i) + public static void min(ref Vector3f a, Vector3f b) { - a.x = Math.Min(a.x, b[i + 0]); - a.y = Math.Min(a.y, b[i + 1]); - a.z = Math.Min(a.z, b[i + 2]); + a.x = Math.Min(a.x, b.x); + a.y = Math.Min(a.y, b.y); + a.z = Math.Min(a.z, b.z); } public static void max(ref Vector3f a, float[] b, int i) @@ -46,11 +46,11 @@ namespace DotRecast.Recast a.z = Math.Max(a.z, b[i + 2]); } - public static void max(ref Vector3f a, Vector3f b, int i) + public static void max(ref Vector3f a, Vector3f b) { - a.x = Math.Max(a.x, b[i + 0]); - a.y = Math.Max(a.y, b[i + 1]); - a.z = Math.Max(a.z, b[i + 2]); + a.x = Math.Max(a.x, b.x); + a.y = Math.Max(a.y, b.y); + a.z = Math.Max(a.z, b.z); } public static void copy(ref Vector3f @out, float[] @in, int i)