seperator RcOffMeshConnection, DtOffMeshConnection

This commit is contained in:
ikpil 2023-08-20 13:08:44 +09:00
parent 90f48d1021
commit 36746745b7
8 changed files with 18 additions and 18 deletions

View File

@ -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];

View File

@ -34,7 +34,7 @@ namespace DotRecast.Recast.Toolset.Geom
private readonly RcVec3f bmax;
private readonly List<RcConvexVolume> _convexVolumes = new List<RcConvexVolume>();
private readonly List<DtOffMeshConnectionParam> _offMeshConnections = new List<DtOffMeshConnectionParam>();
private readonly List<RcOffMeshConnection> _offMeshConnections = new List<RcOffMeshConnection>();
private readonly RcTriMesh _mesh;
public DemoInputGeomProvider(List<float> vertexPositions, List<int> meshFaces) :
@ -110,17 +110,17 @@ namespace DotRecast.Recast.Toolset.Geom
return RcImmutableArray.Create(_mesh);
}
public List<DtOffMeshConnectionParam> GetOffMeshConnections()
public List<RcOffMeshConnection> 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<DtOffMeshConnectionParam> filter)
public void RemoveOffMeshConnections(Predicate<RcOffMeshConnection> filter)
{
//offMeshConnections.RetainAll(offMeshConnections.Stream().Filter(c -> !filter.Test(c)).Collect(ToList()));
_offMeshConnections.RemoveAll(filter); // TODO : 확인 필요

View File

@ -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)

View File

@ -37,9 +37,9 @@ namespace DotRecast.Recast.Geom
IList<RcConvexVolume> ConvexVolumes();
// off mesh connections
public List<DtOffMeshConnectionParam> GetOffMeshConnections();
public List<RcOffMeshConnection> GetOffMeshConnections();
public void AddOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags);
public void RemoveOffMeshConnections(Predicate<DtOffMeshConnectionParam> filter);
public void RemoveOffMeshConnections(Predicate<RcOffMeshConnection> filter);
}
}

View File

@ -26,9 +26,9 @@ namespace DotRecast.Recast.Geom
{
public class RcChunkyTriMesh
{
List<RcChunkyTriMeshNode> nodes;
int ntris;
int maxTrisPerChunk;
private List<RcChunkyTriMeshNode> nodes;
private int ntris;
private int maxTrisPerChunk;
private void CalcExtends(BoundsItem[] items, int imin, int imax, ref RcVec2f bmin, ref RcVec2f bmax)
{

View File

@ -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;

View File

@ -115,7 +115,7 @@ namespace DotRecast.Recast.Geom
return RcImmutableArray.Create(_mesh);
}
public List<DtOffMeshConnectionParam> GetOffMeshConnections()
public List<RcOffMeshConnection> GetOffMeshConnections()
{
throw new NotImplementedException();
}
@ -125,7 +125,7 @@ namespace DotRecast.Recast.Geom
throw new NotImplementedException();
}
public void RemoveOffMeshConnections(Predicate<DtOffMeshConnectionParam> filter)
public void RemoveOffMeshConnections(Predicate<RcOffMeshConnection> filter)
{
throw new NotImplementedException();
}

View File

@ -59,7 +59,7 @@ namespace DotRecast.Recast.Geom
return RcImmutableArray.Create(_mesh);
}
public List<DtOffMeshConnectionParam> GetOffMeshConnections()
public List<RcOffMeshConnection> GetOffMeshConnections()
{
throw new NotImplementedException();
}
@ -69,7 +69,7 @@ namespace DotRecast.Recast.Geom
throw new NotImplementedException();
}
public void RemoveOffMeshConnections(Predicate<DtOffMeshConnectionParam> filter)
public void RemoveOffMeshConnections(Predicate<RcOffMeshConnection> filter)
{
throw new NotImplementedException();
}