From 320c7b4c652146e9272d5289c8c666105f13a441 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 8 Jun 2024 20:56:55 +0900 Subject: [PATCH] Removed RcVecUtils.Dot2D(this RcVec3f @this, Span v, int vi) --- CHANGELOG.md | 3 ++- src/DotRecast.Core/Numerics/RcVecUtils.cs | 7 ------- src/DotRecast.Detour/DtUtils.cs | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e38c3d..645f366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,13 +16,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Changed to reuse samples and edges list in BuildPolyDetail() ### Removed +- Removed RcMeshDetails.VdistSq2(float[], float[]) - Removed RcVecUtils.Dot() - Removed RcVecUtils.Scale() - 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() - Removed RcVecUtils.Create(float[] values) +- Removed RcVecUtils.Dot2D(this RcVec3f @this, Span v, int vi) ### Special Thanks - [@Doprez](https://github.com/Doprez) diff --git a/src/DotRecast.Core/Numerics/RcVecUtils.cs b/src/DotRecast.Core/Numerics/RcVecUtils.cs index 80138ad..68bdaec 100644 --- a/src/DotRecast.Core/Numerics/RcVecUtils.cs +++ b/src/DotRecast.Core/Numerics/RcVecUtils.cs @@ -50,13 +50,6 @@ namespace DotRecast.Core.Numerics @this.Z * v.Z; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Dot2D(this RcVec3f @this, Span v, int vi) - { - return @this.X * v[vi] + - @this.Z * v[vi + 2]; - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Cross(float[] dest, float[] v1, float[] v2) { diff --git a/src/DotRecast.Detour/DtUtils.cs b/src/DotRecast.Detour/DtUtils.cs index 098116c..5f93ea5 100644 --- a/src/DotRecast.Detour/DtUtils.cs +++ b/src/DotRecast.Detour/DtUtils.cs @@ -249,10 +249,10 @@ namespace DotRecast.Detour public static RcVec2f ProjectPoly(RcVec3f axis, Span poly, int npoly) { float rmin, rmax; - rmin = rmax = axis.Dot2D(poly, 0); + rmin = rmax = axis.Dot2D(new RcVec3f(poly)); for (int i = 1; i < npoly; ++i) { - float d = axis.Dot2D(poly, i * 3); + float d = axis.Dot2D(RcVecUtils.Create(poly, i * 3)); rmin = Math.Min(rmin, d); rmax = Math.Max(rmax, d); }