forked from bit/DotRecastNetSim
seperator RcOffMeshConnection, DtOffMeshConnection
This commit is contained in:
parent
90f48d1021
commit
36746745b7
|
@ -52,7 +52,7 @@ namespace DotRecast.Recast.Toolset.Builder
|
||||||
option.offMeshConUserID = new int[option.offMeshConCount];
|
option.offMeshConUserID = new int[option.offMeshConCount];
|
||||||
for (int i = 0; i < option.offMeshConCount; i++)
|
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++)
|
for (int j = 0; j < 6; j++)
|
||||||
{
|
{
|
||||||
option.offMeshConVerts[6 * i + j] = offMeshCon.verts[j];
|
option.offMeshConVerts[6 * i + j] = offMeshCon.verts[j];
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace DotRecast.Recast.Toolset.Geom
|
||||||
private readonly RcVec3f bmax;
|
private readonly RcVec3f bmax;
|
||||||
|
|
||||||
private readonly List<RcConvexVolume> _convexVolumes = new List<RcConvexVolume>();
|
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;
|
private readonly RcTriMesh _mesh;
|
||||||
|
|
||||||
public DemoInputGeomProvider(List<float> vertexPositions, List<int> meshFaces) :
|
public DemoInputGeomProvider(List<float> vertexPositions, List<int> meshFaces) :
|
||||||
|
@ -110,17 +110,17 @@ namespace DotRecast.Recast.Toolset.Geom
|
||||||
return RcImmutableArray.Create(_mesh);
|
return RcImmutableArray.Create(_mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DtOffMeshConnectionParam> GetOffMeshConnections()
|
public List<RcOffMeshConnection> GetOffMeshConnections()
|
||||||
{
|
{
|
||||||
return _offMeshConnections;
|
return _offMeshConnections;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags)
|
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.RetainAll(offMeshConnections.Stream().Filter(c -> !filter.Test(c)).Collect(ToList()));
|
||||||
_offMeshConnections.RemoveAll(filter); // TODO : 확인 필요
|
_offMeshConnections.RemoveAll(filter); // TODO : 확인 필요
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace DotRecast.Recast.Toolset.Tools
|
||||||
// Delete
|
// Delete
|
||||||
// Find nearest link end-point
|
// Find nearest link end-point
|
||||||
float nearestDist = float.MaxValue;
|
float nearestDist = float.MaxValue;
|
||||||
DtOffMeshConnectionParam nearestConnection = null;
|
RcOffMeshConnection nearestConnection = null;
|
||||||
foreach (DtOffMeshConnectionParam offMeshCon in geom.GetOffMeshConnections())
|
foreach (RcOffMeshConnection offMeshCon in geom.GetOffMeshConnections())
|
||||||
{
|
{
|
||||||
float d = Math.Min(RcVec3f.DistSqr(p, offMeshCon.verts, 0), RcVec3f.DistSqr(p, offMeshCon.verts, 3));
|
float d = Math.Min(RcVec3f.DistSqr(p, offMeshCon.verts, 0), RcVec3f.DistSqr(p, offMeshCon.verts, 3));
|
||||||
if (d < nearestDist && Math.Sqrt(d) < settings.agentRadius)
|
if (d < nearestDist && Math.Sqrt(d) < settings.agentRadius)
|
||||||
|
|
|
@ -37,9 +37,9 @@ namespace DotRecast.Recast.Geom
|
||||||
IList<RcConvexVolume> ConvexVolumes();
|
IList<RcConvexVolume> ConvexVolumes();
|
||||||
|
|
||||||
// off mesh connections
|
// 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 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -26,9 +26,9 @@ namespace DotRecast.Recast.Geom
|
||||||
{
|
{
|
||||||
public class RcChunkyTriMesh
|
public class RcChunkyTriMesh
|
||||||
{
|
{
|
||||||
List<RcChunkyTriMeshNode> nodes;
|
private List<RcChunkyTriMeshNode> nodes;
|
||||||
int ntris;
|
private int ntris;
|
||||||
int maxTrisPerChunk;
|
private int maxTrisPerChunk;
|
||||||
|
|
||||||
private void CalcExtends(BoundsItem[] items, int imin, int imax, ref RcVec2f bmin, ref RcVec2f bmax)
|
private void CalcExtends(BoundsItem[] items, int imin, int imax, ref RcVec2f bmin, ref RcVec2f bmax)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ using DotRecast.Core;
|
||||||
|
|
||||||
namespace DotRecast.Recast.Geom
|
namespace DotRecast.Recast.Geom
|
||||||
{
|
{
|
||||||
public class DtOffMeshConnectionParam
|
public class RcOffMeshConnection
|
||||||
{
|
{
|
||||||
public readonly float[] verts;
|
public readonly float[] verts;
|
||||||
public readonly float radius;
|
public readonly float radius;
|
||||||
|
@ -32,7 +32,7 @@ namespace DotRecast.Recast.Geom
|
||||||
|
|
||||||
public readonly int flags;
|
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 = new float[6];
|
||||||
verts[0] = start.x;
|
verts[0] = start.x;
|
|
@ -115,7 +115,7 @@ namespace DotRecast.Recast.Geom
|
||||||
return RcImmutableArray.Create(_mesh);
|
return RcImmutableArray.Create(_mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DtOffMeshConnectionParam> GetOffMeshConnections()
|
public List<RcOffMeshConnection> GetOffMeshConnections()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ namespace DotRecast.Recast.Geom
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveOffMeshConnections(Predicate<DtOffMeshConnectionParam> filter)
|
public void RemoveOffMeshConnections(Predicate<RcOffMeshConnection> filter)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace DotRecast.Recast.Geom
|
||||||
return RcImmutableArray.Create(_mesh);
|
return RcImmutableArray.Create(_mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DtOffMeshConnectionParam> GetOffMeshConnections()
|
public List<RcOffMeshConnection> GetOffMeshConnections()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ namespace DotRecast.Recast.Geom
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveOffMeshConnections(Predicate<DtOffMeshConnectionParam> filter)
|
public void RemoveOffMeshConnections(Predicate<RcOffMeshConnection> filter)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue