forked from mirror/DotRecast
Removed RcVecUtils.Min(), RcVecUtils.Max()
This commit is contained in:
parent
face8eb48e
commit
ed7173dd51
|
@ -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(RcVec3f i, float[] verts, int j)
|
||||||
- Removed RcVecUtils.Subtract(float[] verts, int i, int j)
|
- Removed RcVecUtils.Subtract(float[] verts, int i, int j)
|
||||||
- Removed RcMeshDetails.VdistSq2(float[], float[])
|
- Removed RcMeshDetails.VdistSq2(float[], float[])
|
||||||
|
- Removed RcVecUtils.Min(), RcVecUtils.Max()
|
||||||
|
|
||||||
### Special Thanks
|
### Special Thanks
|
||||||
- [@Doprez](https://github.com/Doprez)
|
- [@Doprez](https://github.com/Doprez)
|
||||||
|
|
|
@ -44,8 +44,8 @@ namespace DotRecast.Detour.Extras
|
||||||
RcVec3f bmax = RcVecUtils.Create(data.verts, data.polys[i].verts[0] * 3);
|
RcVec3f bmax = RcVecUtils.Create(data.verts, data.polys[i].verts[0] * 3);
|
||||||
for (int j = 1; j < data.polys[i].vertCount; j++)
|
for (int j = 1; j < data.polys[i].vertCount; j++)
|
||||||
{
|
{
|
||||||
bmin = RcVecUtils.Min(bmin, data.verts, data.polys[i].verts[j] * 3);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(data.verts, data.polys[i].verts[j] * 3));
|
||||||
bmax = RcVecUtils.Max(bmax, 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);
|
it.bmin[0] = Math.Clamp((int)((bmin.X - data.header.bmin.X) * quantFactor), 0, 0x7fffffff);
|
||||||
|
|
|
@ -324,8 +324,8 @@ namespace DotRecast.Detour
|
||||||
for (int j = 1; j < p.vertCount; ++j)
|
for (int j = 1; j < p.vertCount; ++j)
|
||||||
{
|
{
|
||||||
v = p.verts[j] * 3;
|
v = p.verts[j] * 3;
|
||||||
bmin = RcVecUtils.Min(bmin, tile.data.verts, v);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(tile.data.verts, v));
|
||||||
bmax = RcVecUtils.Max(bmax, tile.data.verts, v);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(tile.data.verts, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DtUtils.OverlapBounds(qmin, qmax, bmin, bmax))
|
if (DtUtils.OverlapBounds(qmin, qmax, bmin, bmax))
|
||||||
|
|
|
@ -168,8 +168,8 @@ namespace DotRecast.Detour
|
||||||
var bmax = RcVecUtils.Create(option.detailVerts, dv);
|
var bmax = RcVecUtils.Create(option.detailVerts, dv);
|
||||||
for (int j = 1; j < ndv; j++)
|
for (int j = 1; j < ndv; j++)
|
||||||
{
|
{
|
||||||
bmin = RcVecUtils.Min(bmin, option.detailVerts, dv + j * 3);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(option.detailVerts, dv + j * 3));
|
||||||
bmax = RcVecUtils.Max(bmax, option.detailVerts, dv + j * 3);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(option.detailVerts, dv + j * 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// BV-tree uses cs for all dimensions
|
// BV-tree uses cs for all dimensions
|
||||||
|
|
|
@ -675,8 +675,8 @@ namespace DotRecast.Detour
|
||||||
for (int j = 1; j < p.vertCount; ++j)
|
for (int j = 1; j < p.vertCount; ++j)
|
||||||
{
|
{
|
||||||
v = p.verts[j] * 3;
|
v = p.verts[j] * 3;
|
||||||
bmin = RcVecUtils.Min(bmin, tile.data.verts, v);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(tile.data.verts, v));
|
||||||
bmax = RcVecUtils.Max(bmax, tile.data.verts, v);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(tile.data.verts, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DtUtils.OverlapBounds(qmin, qmax, bmin, bmax))
|
if (DtUtils.OverlapBounds(qmin, qmax, bmin, bmax))
|
||||||
|
|
|
@ -61,8 +61,8 @@ namespace DotRecast.Recast.Toolset.Geom
|
||||||
bmax = RcVecUtils.Create(vertices);
|
bmax = RcVecUtils.Create(vertices);
|
||||||
for (int i = 1; i < vertices.Length / 3; i++)
|
for (int i = 1; i < vertices.Length / 3; i++)
|
||||||
{
|
{
|
||||||
bmin = RcVecUtils.Min(bmin, vertices, i * 3);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(vertices, i * 3));
|
||||||
bmax = RcVecUtils.Max(bmax, vertices, i * 3);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(vertices, i * 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
_mesh = new RcTriMesh(vertices, faces);
|
_mesh = new RcTriMesh(vertices, faces);
|
||||||
|
|
|
@ -81,8 +81,8 @@ namespace DotRecast.Recast.Geom
|
||||||
bmax = RcVecUtils.Create(vertices);
|
bmax = RcVecUtils.Create(vertices);
|
||||||
for (int i = 1; i < vertices.Length / 3; i++)
|
for (int i = 1; i < vertices.Length / 3; i++)
|
||||||
{
|
{
|
||||||
bmin = RcVecUtils.Min(bmin, vertices, i * 3);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(vertices, i * 3));
|
||||||
bmax = RcVecUtils.Max(bmax, vertices, i * 3);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(vertices, i * 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
_mesh = new RcTriMesh(vertices, faces);
|
_mesh = new RcTriMesh(vertices, faces);
|
||||||
|
|
|
@ -460,8 +460,8 @@ namespace DotRecast.Recast
|
||||||
RcVec3f bmax = RcVecUtils.Create(verts);
|
RcVec3f bmax = RcVecUtils.Create(verts);
|
||||||
for (int i = 3; i < verts.Length; i += 3)
|
for (int i = 3; i < verts.Length; i += 3)
|
||||||
{
|
{
|
||||||
bmin = RcVecUtils.Min(bmin, verts, i);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(verts, i));
|
||||||
bmax = RcVecUtils.Max(bmax, verts, i);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(verts, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
bmin.Y = minY;
|
bmin.Y = minY;
|
||||||
|
|
|
@ -935,8 +935,8 @@ namespace DotRecast.Recast
|
||||||
RcVec3f bmax = RcVecUtils.Create(@in);
|
RcVec3f bmax = RcVecUtils.Create(@in);
|
||||||
for (int i = 1; i < nin; ++i)
|
for (int i = 1; i < nin; ++i)
|
||||||
{
|
{
|
||||||
bmin = RcVecUtils.Min(bmin, @in, i * 3);
|
bmin = RcVec3f.Min(bmin, RcVecUtils.Create(@in, i * 3));
|
||||||
bmax = RcVecUtils.Max(bmax, @in, i * 3);
|
bmax = RcVec3f.Max(bmax, RcVecUtils.Create(@in, i * 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
int x0 = (int)MathF.Floor(bmin.X / sampleDist);
|
int x0 = (int)MathF.Floor(bmin.X / sampleDist);
|
||||||
|
|
|
@ -296,12 +296,12 @@ namespace DotRecast.Recast
|
||||||
{
|
{
|
||||||
// Calculate the bounding box of the triangle.
|
// Calculate the bounding box of the triangle.
|
||||||
RcVec3f triBBMin = RcVecUtils.Create(verts, v0 * 3);
|
RcVec3f triBBMin = RcVecUtils.Create(verts, v0 * 3);
|
||||||
triBBMin = RcVecUtils.Min(triBBMin, verts, v1 * 3);
|
triBBMin = RcVec3f.Min(triBBMin, RcVecUtils.Create(verts, v1 * 3));
|
||||||
triBBMin = RcVecUtils.Min(triBBMin, verts, v2 * 3);
|
triBBMin = RcVec3f.Min(triBBMin, RcVecUtils.Create(verts, v2 * 3));
|
||||||
|
|
||||||
RcVec3f triBBMax = RcVecUtils.Create(verts, v0 * 3);
|
RcVec3f triBBMax = RcVecUtils.Create(verts, v0 * 3);
|
||||||
triBBMax = RcVecUtils.Max(triBBMax, verts, v1 * 3);
|
triBBMax = RcVec3f.Max(triBBMax, RcVecUtils.Create(verts, v1 * 3));
|
||||||
triBBMax = RcVecUtils.Max(triBBMax, verts, v2 * 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 the triangle does not touch the bounding box of the heightfield, skip the triangle.
|
||||||
if (!OverlapBounds(triBBMin, triBBMax, heightfieldBBMin, heightfieldBBMax))
|
if (!OverlapBounds(triBBMin, triBBMax, heightfieldBBMin, heightfieldBBMax))
|
||||||
|
|
Loading…
Reference in New Issue