From 36746745b7102b8405a58cf19cbfcd975f00b5c8 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sun, 20 Aug 2023 13:08:44 +0900 Subject: [PATCH] seperator RcOffMeshConnection, DtOffMeshConnection --- .../Builder/DemoNavMeshBuilder.cs | 2 +- .../Geom/DemoInputGeomProvider.cs | 8 ++++---- .../Tools/OffMeshConnectionToolImpl.cs | 4 ++-- src/DotRecast.Recast/Geom/IInputGeomProvider.cs | 4 ++-- src/DotRecast.Recast/Geom/RcChunkyTriMesh.cs | 6 +++--- ...DtOffMeshConnectionParam.cs => RcOffMeshConnection.cs} | 4 ++-- src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs | 4 ++-- .../Geom/SingleTrimeshInputGeomProvider.cs | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) rename src/DotRecast.Recast/Geom/{DtOffMeshConnectionParam.cs => RcOffMeshConnection.cs} (91%) diff --git a/src/DotRecast.Recast.Toolset/Builder/DemoNavMeshBuilder.cs b/src/DotRecast.Recast.Toolset/Builder/DemoNavMeshBuilder.cs index 8be12e7..26621a4 100644 --- a/src/DotRecast.Recast.Toolset/Builder/DemoNavMeshBuilder.cs +++ b/src/DotRecast.Recast.Toolset/Builder/DemoNavMeshBuilder.cs @@ -52,7 +52,7 @@ namespace DotRecast.Recast.Toolset.Builder option.offMeshConUserID = new int[option.offMeshConCount]; for (int i = 0; i < option.offMeshConCount; i++) { - DtOffMeshConnectionParam offMeshCon = geom.GetOffMeshConnections()[i]; + RcOffMeshConnection offMeshCon = geom.GetOffMeshConnections()[i]; for (int j = 0; j < 6; j++) { option.offMeshConVerts[6 * i + j] = offMeshCon.verts[j]; diff --git a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs index fe5add2..3b32921 100644 --- a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs +++ b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs @@ -34,7 +34,7 @@ namespace DotRecast.Recast.Toolset.Geom private readonly RcVec3f bmax; private readonly List _convexVolumes = new List(); - private readonly List _offMeshConnections = new List(); + private readonly List _offMeshConnections = new List(); private readonly RcTriMesh _mesh; public DemoInputGeomProvider(List vertexPositions, List meshFaces) : @@ -110,17 +110,17 @@ namespace DotRecast.Recast.Toolset.Geom return RcImmutableArray.Create(_mesh); } - public List GetOffMeshConnections() + public List GetOffMeshConnections() { return _offMeshConnections; } public void AddOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags) { - _offMeshConnections.Add(new DtOffMeshConnectionParam(start, end, radius, bidir, area, flags)); + _offMeshConnections.Add(new RcOffMeshConnection(start, end, radius, bidir, area, flags)); } - public void RemoveOffMeshConnections(Predicate filter) + public void RemoveOffMeshConnections(Predicate filter) { //offMeshConnections.RetainAll(offMeshConnections.Stream().Filter(c -> !filter.Test(c)).Collect(ToList())); _offMeshConnections.RemoveAll(filter); // TODO : 확인 필요 diff --git a/src/DotRecast.Recast.Toolset/Tools/OffMeshConnectionToolImpl.cs b/src/DotRecast.Recast.Toolset/Tools/OffMeshConnectionToolImpl.cs index 8d00407..6e15da2 100644 --- a/src/DotRecast.Recast.Toolset/Tools/OffMeshConnectionToolImpl.cs +++ b/src/DotRecast.Recast.Toolset/Tools/OffMeshConnectionToolImpl.cs @@ -40,8 +40,8 @@ namespace DotRecast.Recast.Toolset.Tools // Delete // Find nearest link end-point float nearestDist = float.MaxValue; - DtOffMeshConnectionParam nearestConnection = null; - foreach (DtOffMeshConnectionParam offMeshCon in geom.GetOffMeshConnections()) + RcOffMeshConnection nearestConnection = null; + foreach (RcOffMeshConnection offMeshCon in geom.GetOffMeshConnections()) { float d = Math.Min(RcVec3f.DistSqr(p, offMeshCon.verts, 0), RcVec3f.DistSqr(p, offMeshCon.verts, 3)); if (d < nearestDist && Math.Sqrt(d) < settings.agentRadius) diff --git a/src/DotRecast.Recast/Geom/IInputGeomProvider.cs b/src/DotRecast.Recast/Geom/IInputGeomProvider.cs index 99333ac..ff206fb 100644 --- a/src/DotRecast.Recast/Geom/IInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/IInputGeomProvider.cs @@ -37,9 +37,9 @@ namespace DotRecast.Recast.Geom IList ConvexVolumes(); // off mesh connections - public List GetOffMeshConnections(); + public List GetOffMeshConnections(); public void AddOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags); - public void RemoveOffMeshConnections(Predicate filter); + public void RemoveOffMeshConnections(Predicate filter); } } \ No newline at end of file diff --git a/src/DotRecast.Recast/Geom/RcChunkyTriMesh.cs b/src/DotRecast.Recast/Geom/RcChunkyTriMesh.cs index b28964d..1f54014 100644 --- a/src/DotRecast.Recast/Geom/RcChunkyTriMesh.cs +++ b/src/DotRecast.Recast/Geom/RcChunkyTriMesh.cs @@ -26,9 +26,9 @@ namespace DotRecast.Recast.Geom { public class RcChunkyTriMesh { - List nodes; - int ntris; - int maxTrisPerChunk; + private List nodes; + private int ntris; + private int maxTrisPerChunk; private void CalcExtends(BoundsItem[] items, int imin, int imax, ref RcVec2f bmin, ref RcVec2f bmax) { diff --git a/src/DotRecast.Recast/Geom/DtOffMeshConnectionParam.cs b/src/DotRecast.Recast/Geom/RcOffMeshConnection.cs similarity index 91% rename from src/DotRecast.Recast/Geom/DtOffMeshConnectionParam.cs rename to src/DotRecast.Recast/Geom/RcOffMeshConnection.cs index b5aca28..fd916f8 100644 --- a/src/DotRecast.Recast/Geom/DtOffMeshConnectionParam.cs +++ b/src/DotRecast.Recast/Geom/RcOffMeshConnection.cs @@ -22,7 +22,7 @@ using DotRecast.Core; namespace DotRecast.Recast.Geom { - public class DtOffMeshConnectionParam + public class RcOffMeshConnection { public readonly float[] verts; public readonly float radius; @@ -32,7 +32,7 @@ namespace DotRecast.Recast.Geom public readonly int flags; - public DtOffMeshConnectionParam(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags) + public RcOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags) { verts = new float[6]; verts[0] = start.x; diff --git a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs index 46b6a11..1404d98 100644 --- a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs @@ -115,7 +115,7 @@ namespace DotRecast.Recast.Geom return RcImmutableArray.Create(_mesh); } - public List GetOffMeshConnections() + public List GetOffMeshConnections() { throw new NotImplementedException(); } @@ -125,7 +125,7 @@ namespace DotRecast.Recast.Geom throw new NotImplementedException(); } - public void RemoveOffMeshConnections(Predicate filter) + public void RemoveOffMeshConnections(Predicate filter) { throw new NotImplementedException(); } diff --git a/src/DotRecast.Recast/Geom/SingleTrimeshInputGeomProvider.cs b/src/DotRecast.Recast/Geom/SingleTrimeshInputGeomProvider.cs index b9dc0a4..814a76b 100644 --- a/src/DotRecast.Recast/Geom/SingleTrimeshInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/SingleTrimeshInputGeomProvider.cs @@ -59,7 +59,7 @@ namespace DotRecast.Recast.Geom return RcImmutableArray.Create(_mesh); } - public List GetOffMeshConnections() + public List GetOffMeshConnections() { throw new NotImplementedException(); } @@ -69,7 +69,7 @@ namespace DotRecast.Recast.Geom throw new NotImplementedException(); } - public void RemoveOffMeshConnections(Predicate filter) + public void RemoveOffMeshConnections(Predicate filter) { throw new NotImplementedException(); }