Removed RcVecUtils.Min(), RcVecUtils.Max()

This commit is contained in:
ikpil 2024-06-08 14:21:38 +09:00
parent face8eb48e
commit ed7173dd51
10 changed files with 21 additions and 20 deletions

View File

@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Removed RcVecUtils.Subtract(RcVec3f i, float[] verts, int j)
- Removed RcVecUtils.Subtract(float[] verts, int i, int j)
- Removed RcMeshDetails.VdistSq2(float[], float[])
- Removed RcVecUtils.Min(), RcVecUtils.Max()
### Special Thanks
- [@Doprez](https://github.com/Doprez)

View File

@ -44,8 +44,8 @@ namespace DotRecast.Detour.Extras
RcVec3f bmax = RcVecUtils.Create(data.verts, data.polys[i].verts[0] * 3);
for (int j = 1; j < data.polys[i].vertCount; j++)
{
bmin = RcVecUtils.Min(bmin, data.verts, data.polys[i].verts[j] * 3);
bmax = RcVecUtils.Max(bmax, data.verts, data.polys[i].verts[j] * 3);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(data.verts, data.polys[i].verts[j] * 3));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(data.verts, data.polys[i].verts[j] * 3));
}
it.bmin[0] = Math.Clamp((int)((bmin.X - data.header.bmin.X) * quantFactor), 0, 0x7fffffff);

View File

@ -324,8 +324,8 @@ namespace DotRecast.Detour
for (int j = 1; j < p.vertCount; ++j)
{
v = p.verts[j] * 3;
bmin = RcVecUtils.Min(bmin, tile.data.verts, v);
bmax = RcVecUtils.Max(bmax, tile.data.verts, v);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(tile.data.verts, v));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(tile.data.verts, v));
}
if (DtUtils.OverlapBounds(qmin, qmax, bmin, bmax))

View File

@ -168,8 +168,8 @@ namespace DotRecast.Detour
var bmax = RcVecUtils.Create(option.detailVerts, dv);
for (int j = 1; j < ndv; j++)
{
bmin = RcVecUtils.Min(bmin, option.detailVerts, dv + j * 3);
bmax = RcVecUtils.Max(bmax, option.detailVerts, dv + j * 3);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(option.detailVerts, dv + j * 3));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(option.detailVerts, dv + j * 3));
}
// BV-tree uses cs for all dimensions

View File

@ -675,8 +675,8 @@ namespace DotRecast.Detour
for (int j = 1; j < p.vertCount; ++j)
{
v = p.verts[j] * 3;
bmin = RcVecUtils.Min(bmin, tile.data.verts, v);
bmax = RcVecUtils.Max(bmax, tile.data.verts, v);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(tile.data.verts, v));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(tile.data.verts, v));
}
if (DtUtils.OverlapBounds(qmin, qmax, bmin, bmax))

View File

@ -61,8 +61,8 @@ namespace DotRecast.Recast.Toolset.Geom
bmax = RcVecUtils.Create(vertices);
for (int i = 1; i < vertices.Length / 3; i++)
{
bmin = RcVecUtils.Min(bmin, vertices, i * 3);
bmax = RcVecUtils.Max(bmax, vertices, i * 3);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(vertices, i * 3));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(vertices, i * 3));
}
_mesh = new RcTriMesh(vertices, faces);

View File

@ -81,8 +81,8 @@ namespace DotRecast.Recast.Geom
bmax = RcVecUtils.Create(vertices);
for (int i = 1; i < vertices.Length / 3; i++)
{
bmin = RcVecUtils.Min(bmin, vertices, i * 3);
bmax = RcVecUtils.Max(bmax, vertices, i * 3);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(vertices, i * 3));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(vertices, i * 3));
}
_mesh = new RcTriMesh(vertices, faces);

View File

@ -460,8 +460,8 @@ namespace DotRecast.Recast
RcVec3f bmax = RcVecUtils.Create(verts);
for (int i = 3; i < verts.Length; i += 3)
{
bmin = RcVecUtils.Min(bmin, verts, i);
bmax = RcVecUtils.Max(bmax, verts, i);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(verts, i));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(verts, i));
}
bmin.Y = minY;

View File

@ -935,8 +935,8 @@ namespace DotRecast.Recast
RcVec3f bmax = RcVecUtils.Create(@in);
for (int i = 1; i < nin; ++i)
{
bmin = RcVecUtils.Min(bmin, @in, i * 3);
bmax = RcVecUtils.Max(bmax, @in, i * 3);
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(@in, i * 3));
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(@in, i * 3));
}
int x0 = (int)MathF.Floor(bmin.X / sampleDist);

View File

@ -296,12 +296,12 @@ namespace DotRecast.Recast
{
// Calculate the bounding box of the triangle.
RcVec3f triBBMin = RcVecUtils.Create(verts, v0 * 3);
triBBMin = RcVecUtils.Min(triBBMin, verts, v1 * 3);
triBBMin = RcVecUtils.Min(triBBMin, verts, v2 * 3);
triBBMin = RcVec3f.Min(triBBMin, RcVecUtils.Create(verts, v1 * 3));
triBBMin = RcVec3f.Min(triBBMin, RcVecUtils.Create(verts, v2 * 3));
RcVec3f triBBMax = RcVecUtils.Create(verts, v0 * 3);
triBBMax = RcVecUtils.Max(triBBMax, verts, v1 * 3);
triBBMax = RcVecUtils.Max(triBBMax, verts, v2 * 3);
triBBMax = RcVec3f.Max(triBBMax, RcVecUtils.Create(verts, v1 * 3));
triBBMax = RcVec3f.Max(triBBMax, RcVecUtils.Create(verts, v2 * 3));
// If the triangle does not touch the bounding box of the heightfield, skip the triangle.
if (!OverlapBounds(triBBMin, triBBMax, heightfieldBBMin, heightfieldBBMax))