From ed7173dd51013e6f5b70087853702528e9de0986 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 8 Jun 2024 14:21:38 +0900 Subject: [PATCH] Removed RcVecUtils.Min(), RcVecUtils.Max() --- CHANGELOG.md | 1 + src/DotRecast.Detour.Extras/BVTreeBuilder.cs | 4 ++-- src/DotRecast.Detour/DtNavMesh.cs | 4 ++-- src/DotRecast.Detour/DtNavMeshBuilder.cs | 4 ++-- src/DotRecast.Detour/DtNavMeshQuery.cs | 4 ++-- .../Geom/DemoInputGeomProvider.cs | 4 ++-- src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs | 4 ++-- src/DotRecast.Recast/RcAreas.cs | 4 ++-- src/DotRecast.Recast/RcMeshDetails.cs | 4 ++-- src/DotRecast.Recast/RcRasterizations.cs | 8 ++++---- 10 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e3b148..74ef1b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs index e23c892..e31200f 100644 --- a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs +++ b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs @@ -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); diff --git a/src/DotRecast.Detour/DtNavMesh.cs b/src/DotRecast.Detour/DtNavMesh.cs index b1a0cad..b6aac0c 100644 --- a/src/DotRecast.Detour/DtNavMesh.cs +++ b/src/DotRecast.Detour/DtNavMesh.cs @@ -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)) diff --git a/src/DotRecast.Detour/DtNavMeshBuilder.cs b/src/DotRecast.Detour/DtNavMeshBuilder.cs index a016139..ba6b452 100644 --- a/src/DotRecast.Detour/DtNavMeshBuilder.cs +++ b/src/DotRecast.Detour/DtNavMeshBuilder.cs @@ -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 diff --git a/src/DotRecast.Detour/DtNavMeshQuery.cs b/src/DotRecast.Detour/DtNavMeshQuery.cs index cceba0b..2978f9a 100644 --- a/src/DotRecast.Detour/DtNavMeshQuery.cs +++ b/src/DotRecast.Detour/DtNavMeshQuery.cs @@ -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)) diff --git a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs index 61dbf11..444a654 100644 --- a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs +++ b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs @@ -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); diff --git a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs index bef11fc..74b4ff4 100644 --- a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs @@ -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); diff --git a/src/DotRecast.Recast/RcAreas.cs b/src/DotRecast.Recast/RcAreas.cs index 75d68f8..2405883 100644 --- a/src/DotRecast.Recast/RcAreas.cs +++ b/src/DotRecast.Recast/RcAreas.cs @@ -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; diff --git a/src/DotRecast.Recast/RcMeshDetails.cs b/src/DotRecast.Recast/RcMeshDetails.cs index 0230953..891c632 100644 --- a/src/DotRecast.Recast/RcMeshDetails.cs +++ b/src/DotRecast.Recast/RcMeshDetails.cs @@ -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); diff --git a/src/DotRecast.Recast/RcRasterizations.cs b/src/DotRecast.Recast/RcRasterizations.cs index 5e5e164..dbe74e1 100644 --- a/src/DotRecast.Recast/RcRasterizations.cs +++ b/src/DotRecast.Recast/RcRasterizations.cs @@ -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))