forked from bit/DotRecastNetSim
typo
This commit is contained in:
parent
21a6b1c5e8
commit
e6e17d83a2
|
@ -20,33 +20,28 @@ freely, subject to the following restrictions:
|
||||||
|
|
||||||
namespace DotRecast.Detour
|
namespace DotRecast.Detour
|
||||||
{
|
{
|
||||||
/**
|
/// Defines an navigation mesh off-mesh connection within a dtMeshTile object.
|
||||||
* Defines an navigation mesh off-mesh connection within a dtMeshTile object. An off-mesh connection is a user defined
|
/// An off-mesh connection is a user defined traversable connection made up to two vertices.
|
||||||
* traversable connection made up to two vertices.
|
|
||||||
*/
|
|
||||||
public class DtOffMeshConnection
|
public class DtOffMeshConnection
|
||||||
{
|
{
|
||||||
/** The endpoints of the connection. [(ax, ay, az, bx, by, bz)] */
|
/// The endpoints of the connection. [(ax, ay, az, bx, by, bz)]
|
||||||
public float[] pos = new float[6];
|
public float[] pos = new float[6];
|
||||||
|
|
||||||
/** The radius of the endpoints. [Limit: >= 0] */
|
/// The radius of the endpoints. [Limit: >= 0]
|
||||||
public float rad;
|
public float rad;
|
||||||
|
|
||||||
/** The polygon reference of the connection within the tile. */
|
/// The polygon reference of the connection within the tile.
|
||||||
public int poly;
|
public int poly;
|
||||||
|
|
||||||
/**
|
/// Link flags.
|
||||||
* Link flags.
|
/// @note These are not the connection's user defined flags. Those are assigned via the
|
||||||
*
|
/// connection's dtPoly definition. These are link flags used for internal purposes.
|
||||||
* @note These are not the connection's user defined flags. Those are assigned via the connection's Poly definition.
|
|
||||||
* These are link flags used for internal purposes.
|
|
||||||
*/
|
|
||||||
public int flags;
|
public int flags;
|
||||||
|
|
||||||
/** End point side. */
|
/// End point side.
|
||||||
public int side;
|
public int side;
|
||||||
|
|
||||||
/** The id of the offmesh connection. (User assigned when the navigation mesh is built.) */
|
/// The id of the offmesh connection. (User assigned when the navigation mesh is built.)
|
||||||
public int userId;
|
public int userId;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -228,7 +228,7 @@ public class NavMeshRenderer
|
||||||
_debugDraw.DepthMask(false);
|
_debugDraw.DepthMask(false);
|
||||||
|
|
||||||
_debugDraw.Begin(DebugDrawPrimitives.LINES, 2.0f);
|
_debugDraw.Begin(DebugDrawPrimitives.LINES, 2.0f);
|
||||||
foreach (DemoOffMeshConnection con in geom.GetOffMeshConnections())
|
foreach (var con in geom.GetOffMeshConnections())
|
||||||
{
|
{
|
||||||
float[] v = con.verts;
|
float[] v = con.verts;
|
||||||
_debugDraw.Vertex(v[0], v[1], v[2], baseColor);
|
_debugDraw.Vertex(v[0], v[1], v[2], baseColor);
|
||||||
|
|
|
@ -1,48 +1,49 @@
|
||||||
using DotRecast.Detour;
|
using DotRecast.Detour;
|
||||||
using DotRecast.Recast.DemoTool.Geom;
|
using DotRecast.Recast.DemoTool.Geom;
|
||||||
|
using DotRecast.Recast.Geom;
|
||||||
|
|
||||||
namespace DotRecast.Recast.DemoTool.Builder
|
namespace DotRecast.Recast.DemoTool.Builder
|
||||||
{
|
{
|
||||||
public abstract class AbstractNavMeshBuilder
|
public static class DemoNavMeshBuilder
|
||||||
{
|
{
|
||||||
protected DtNavMeshCreateParams GetNavMeshCreateParams(DemoInputGeomProvider m_geom, float m_cellSize,
|
public static DtNavMeshCreateParams GetNavMeshCreateParams(DemoInputGeomProvider geom, float cellSize,
|
||||||
float m_cellHeight, float m_agentHeight, float m_agentRadius, float m_agentMaxClimb,
|
float cellHeight, float agentHeight, float agentRadius, float agentMaxClimb,
|
||||||
RecastBuilderResult rcResult)
|
RecastBuilderResult rcResult)
|
||||||
{
|
{
|
||||||
RcPolyMesh m_pmesh = rcResult.GetMesh();
|
RcPolyMesh pmesh = rcResult.GetMesh();
|
||||||
RcPolyMeshDetail m_dmesh = rcResult.GetMeshDetail();
|
RcPolyMeshDetail dmesh = rcResult.GetMeshDetail();
|
||||||
DtNavMeshCreateParams option = new DtNavMeshCreateParams();
|
DtNavMeshCreateParams option = new DtNavMeshCreateParams();
|
||||||
for (int i = 0; i < m_pmesh.npolys; ++i)
|
for (int i = 0; i < pmesh.npolys; ++i)
|
||||||
{
|
{
|
||||||
m_pmesh.flags[i] = 1;
|
pmesh.flags[i] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
option.verts = m_pmesh.verts;
|
option.verts = pmesh.verts;
|
||||||
option.vertCount = m_pmesh.nverts;
|
option.vertCount = pmesh.nverts;
|
||||||
option.polys = m_pmesh.polys;
|
option.polys = pmesh.polys;
|
||||||
option.polyAreas = m_pmesh.areas;
|
option.polyAreas = pmesh.areas;
|
||||||
option.polyFlags = m_pmesh.flags;
|
option.polyFlags = pmesh.flags;
|
||||||
option.polyCount = m_pmesh.npolys;
|
option.polyCount = pmesh.npolys;
|
||||||
option.nvp = m_pmesh.nvp;
|
option.nvp = pmesh.nvp;
|
||||||
if (m_dmesh != null)
|
if (dmesh != null)
|
||||||
{
|
{
|
||||||
option.detailMeshes = m_dmesh.meshes;
|
option.detailMeshes = dmesh.meshes;
|
||||||
option.detailVerts = m_dmesh.verts;
|
option.detailVerts = dmesh.verts;
|
||||||
option.detailVertsCount = m_dmesh.nverts;
|
option.detailVertsCount = dmesh.nverts;
|
||||||
option.detailTris = m_dmesh.tris;
|
option.detailTris = dmesh.tris;
|
||||||
option.detailTriCount = m_dmesh.ntris;
|
option.detailTriCount = dmesh.ntris;
|
||||||
}
|
}
|
||||||
|
|
||||||
option.walkableHeight = m_agentHeight;
|
option.walkableHeight = agentHeight;
|
||||||
option.walkableRadius = m_agentRadius;
|
option.walkableRadius = agentRadius;
|
||||||
option.walkableClimb = m_agentMaxClimb;
|
option.walkableClimb = agentMaxClimb;
|
||||||
option.bmin = m_pmesh.bmin;
|
option.bmin = pmesh.bmin;
|
||||||
option.bmax = m_pmesh.bmax;
|
option.bmax = pmesh.bmax;
|
||||||
option.cs = m_cellSize;
|
option.cs = cellSize;
|
||||||
option.ch = m_cellHeight;
|
option.ch = cellHeight;
|
||||||
option.buildBvTree = true;
|
option.buildBvTree = true;
|
||||||
|
|
||||||
option.offMeshConCount = m_geom.GetOffMeshConnections().Count;
|
option.offMeshConCount = geom.GetOffMeshConnections().Count;
|
||||||
option.offMeshConVerts = new float[option.offMeshConCount * 6];
|
option.offMeshConVerts = new float[option.offMeshConCount * 6];
|
||||||
option.offMeshConRad = new float[option.offMeshConCount];
|
option.offMeshConRad = new float[option.offMeshConCount];
|
||||||
option.offMeshConDir = new int[option.offMeshConCount];
|
option.offMeshConDir = new int[option.offMeshConCount];
|
||||||
|
@ -51,7 +52,7 @@ namespace DotRecast.Recast.DemoTool.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++)
|
||||||
{
|
{
|
||||||
DemoOffMeshConnection offMeshCon = m_geom.GetOffMeshConnections()[i];
|
DemoOffMeshConnection 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];
|
||||||
|
@ -66,7 +67,7 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DtMeshData UpdateAreaAndFlags(DtMeshData meshData)
|
public static DtMeshData UpdateAreaAndFlags(DtMeshData meshData)
|
||||||
{
|
{
|
||||||
// Update poly flags from areas.
|
// Update poly flags from areas.
|
||||||
for (int i = 0; i < meshData.polys.Length; ++i)
|
for (int i = 0; i < meshData.polys.Length; ++i)
|
|
@ -23,7 +23,6 @@ using System.Linq;
|
||||||
|
|
||||||
namespace DotRecast.Recast.DemoTool.Builder
|
namespace DotRecast.Recast.DemoTool.Builder
|
||||||
{
|
{
|
||||||
|
|
||||||
public class SampleAreaModifications
|
public class SampleAreaModifications
|
||||||
{
|
{
|
||||||
public const int SAMPLE_POLYAREA_TYPE_GROUND = 0x0;
|
public const int SAMPLE_POLYAREA_TYPE_GROUND = 0x0;
|
||||||
|
@ -35,6 +34,13 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
public const int SAMPLE_POLYAREA_TYPE_JUMP_AUTO = 0x6;
|
public const int SAMPLE_POLYAREA_TYPE_JUMP_AUTO = 0x6;
|
||||||
public const int SAMPLE_POLYAREA_TYPE_WALKABLE = 0x3f;
|
public const int SAMPLE_POLYAREA_TYPE_WALKABLE = 0x3f;
|
||||||
|
|
||||||
|
public static readonly int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road)
|
||||||
|
public static readonly int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water).
|
||||||
|
public static readonly int SAMPLE_POLYFLAGS_DOOR = 0x04; // Ability to move through doors.
|
||||||
|
public static readonly int SAMPLE_POLYFLAGS_JUMP = 0x08; // Ability to jump.
|
||||||
|
public static readonly int SAMPLE_POLYFLAGS_DISABLED = 0x10; // Disabled polygon
|
||||||
|
public static readonly int SAMPLE_POLYFLAGS_ALL = 0xffff; // All abilities.
|
||||||
|
|
||||||
public static readonly RcAreaModification SAMPLE_AREAMOD_WALKABLE = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WALKABLE);
|
public static readonly RcAreaModification SAMPLE_AREAMOD_WALKABLE = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WALKABLE);
|
||||||
public static readonly RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND);
|
public static readonly RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND);
|
||||||
public static readonly RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER);
|
public static readonly RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER);
|
||||||
|
@ -57,12 +63,5 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
{
|
{
|
||||||
return Values.FirstOrDefault(x => x.Value == value) ?? SAMPLE_AREAMOD_GRASS;
|
return Values.FirstOrDefault(x => x.Value == value) ?? SAMPLE_AREAMOD_GRASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road)
|
|
||||||
public static readonly int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water).
|
|
||||||
public static readonly int SAMPLE_POLYFLAGS_DOOR = 0x04; // Ability to move through doors.
|
|
||||||
public static readonly int SAMPLE_POLYFLAGS_JUMP = 0x08; // Ability to jump.
|
|
||||||
public static readonly int SAMPLE_POLYFLAGS_DISABLED = 0x10; // Disabled polygon
|
|
||||||
public static readonly int SAMPLE_POLYFLAGS_ALL = 0xffff; // All abilities.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,7 +24,7 @@ using DotRecast.Recast.DemoTool.Geom;
|
||||||
|
|
||||||
namespace DotRecast.Recast.DemoTool.Builder
|
namespace DotRecast.Recast.DemoTool.Builder
|
||||||
{
|
{
|
||||||
public class SoloNavMeshBuilder : AbstractNavMeshBuilder
|
public class SoloNavMeshBuilder
|
||||||
{
|
{
|
||||||
public NavMeshBuildResult Build(DemoInputGeomProvider geom, PartitionType partitionType,
|
public NavMeshBuildResult Build(DemoInputGeomProvider geom, PartitionType partitionType,
|
||||||
float cellSize, float cellHeight, float agentHeight, float agentRadius, float agentMaxClimb,
|
float cellSize, float cellHeight, float agentHeight, float agentRadius, float agentMaxClimb,
|
||||||
|
@ -62,12 +62,13 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
return rcBuilder.Build(geom, bcfg);
|
return rcBuilder.Build(geom, bcfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DtMeshData BuildMeshData(DemoInputGeomProvider geom, float cellSize, float cellHeight, float agentHeight,
|
public DtMeshData BuildMeshData(DemoInputGeomProvider geom, float cellSize, float cellHeight, float agentHeight,
|
||||||
float agentRadius, float agentMaxClimb, RecastBuilderResult result)
|
float agentRadius, float agentMaxClimb, RecastBuilderResult result)
|
||||||
{
|
{
|
||||||
DtNavMeshCreateParams option = GetNavMeshCreateParams(geom, cellSize, cellHeight, agentHeight, agentRadius,
|
DtNavMeshCreateParams option = DemoNavMeshBuilder
|
||||||
agentMaxClimb, result);
|
.GetNavMeshCreateParams(geom, cellSize, cellHeight, agentHeight, agentRadius, agentMaxClimb, result);
|
||||||
return UpdateAreaAndFlags(NavMeshBuilder.CreateNavMeshData(option));
|
var meshData = NavMeshBuilder.CreateNavMeshData(option);
|
||||||
|
return DemoNavMeshBuilder.UpdateAreaAndFlags(meshData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -19,14 +19,12 @@ freely, subject to the following restrictions:
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using DotRecast.Core;
|
|
||||||
using DotRecast.Detour;
|
using DotRecast.Detour;
|
||||||
using DotRecast.Recast.DemoTool.Geom;
|
using DotRecast.Recast.DemoTool.Geom;
|
||||||
using static DotRecast.Core.RcMath;
|
|
||||||
|
|
||||||
namespace DotRecast.Recast.DemoTool.Builder
|
namespace DotRecast.Recast.DemoTool.Builder
|
||||||
{
|
{
|
||||||
public class TileNavMeshBuilder : AbstractNavMeshBuilder
|
public class TileNavMeshBuilder
|
||||||
{
|
{
|
||||||
public TileNavMeshBuilder()
|
public TileNavMeshBuilder()
|
||||||
{
|
{
|
||||||
|
@ -47,7 +45,7 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
return new NavMeshBuildResult(results, tileNavMesh);
|
return new NavMeshBuildResult(results, tileNavMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<RecastBuilderResult> BuildRecastResult(DemoInputGeomProvider geom, PartitionType partitionType,
|
public List<RecastBuilderResult> BuildRecastResult(DemoInputGeomProvider geom, PartitionType partitionType,
|
||||||
float cellSize, float cellHeight, float agentHeight, float agentRadius, float agentMaxClimb,
|
float cellSize, float cellHeight, float agentHeight, float agentRadius, float agentMaxClimb,
|
||||||
float agentMaxSlope, int regionMinSize, int regionMergeSize, float edgeMaxLen, float edgeMaxError,
|
float agentMaxSlope, int regionMinSize, int regionMergeSize, float edgeMaxLen, float edgeMaxError,
|
||||||
int vertsPerPoly, float detailSampleDist, float detailSampleMaxError, bool filterLowHangingObstacles,
|
int vertsPerPoly, float detailSampleDist, float detailSampleMaxError, bool filterLowHangingObstacles,
|
||||||
|
@ -63,7 +61,7 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
return rcBuilder.BuildTiles(geom, cfg, Task.Factory);
|
return rcBuilder.BuildTiles(geom, cfg, Task.Factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DtNavMesh BuildNavMesh(DemoInputGeomProvider geom, List<DtMeshData> meshData, float cellSize, int tileSize, int vertsPerPoly)
|
public DtNavMesh BuildNavMesh(DemoInputGeomProvider geom, List<DtMeshData> meshData, float cellSize, int tileSize, int vertsPerPoly)
|
||||||
{
|
{
|
||||||
DtNavMeshParams navMeshParams = new DtNavMeshParams();
|
DtNavMeshParams navMeshParams = new DtNavMeshParams();
|
||||||
navMeshParams.orig = geom.GetMeshBoundsMin();
|
navMeshParams.orig = geom.GetMeshBoundsMin();
|
||||||
|
@ -79,6 +77,31 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
return navMesh;
|
return navMesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<DtMeshData> BuildMeshData(DemoInputGeomProvider geom, float cellSize, float cellHeight, float agentHeight,
|
||||||
|
float agentRadius, float agentMaxClimb, List<RecastBuilderResult> results)
|
||||||
|
{
|
||||||
|
// Add tiles to nav mesh
|
||||||
|
List<DtMeshData> meshData = new List<DtMeshData>();
|
||||||
|
foreach (RecastBuilderResult result in results)
|
||||||
|
{
|
||||||
|
int x = result.tileX;
|
||||||
|
int z = result.tileZ;
|
||||||
|
DtNavMeshCreateParams option = DemoNavMeshBuilder
|
||||||
|
.GetNavMeshCreateParams(geom, cellSize, cellHeight, agentHeight, agentRadius, agentMaxClimb, result);
|
||||||
|
|
||||||
|
option.tileX = x;
|
||||||
|
option.tileZ = z;
|
||||||
|
DtMeshData md = NavMeshBuilder.CreateNavMeshData(option);
|
||||||
|
if (md != null)
|
||||||
|
{
|
||||||
|
meshData.Add(DemoNavMeshBuilder.UpdateAreaAndFlags(md));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return meshData;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int GetMaxTiles(DemoInputGeomProvider geom, float cellSize, int tileSize)
|
public int GetMaxTiles(DemoInputGeomProvider geom, float cellSize, int tileSize)
|
||||||
{
|
{
|
||||||
int tileBits = GetTileBits(geom, cellSize, tileSize);
|
int tileBits = GetTileBits(geom, cellSize, tileSize);
|
||||||
|
@ -107,28 +130,5 @@ namespace DotRecast.Recast.DemoTool.Builder
|
||||||
int th = (gh + tileSize - 1) / tileSize;
|
int th = (gh + tileSize - 1) / tileSize;
|
||||||
return new int[] { tw, th };
|
return new int[] { tw, th };
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<DtMeshData> BuildMeshData(DemoInputGeomProvider geom, float cellSize, float cellHeight, float agentHeight,
|
|
||||||
float agentRadius, float agentMaxClimb, List<RecastBuilderResult> results)
|
|
||||||
{
|
|
||||||
// Add tiles to nav mesh
|
|
||||||
List<DtMeshData> meshData = new List<DtMeshData>();
|
|
||||||
foreach (RecastBuilderResult result in results)
|
|
||||||
{
|
|
||||||
int x = result.tileX;
|
|
||||||
int z = result.tileZ;
|
|
||||||
DtNavMeshCreateParams option = GetNavMeshCreateParams(geom, cellSize, cellHeight, agentHeight,
|
|
||||||
agentRadius, agentMaxClimb, result);
|
|
||||||
option.tileX = x;
|
|
||||||
option.tileZ = z;
|
|
||||||
DtMeshData md = NavMeshBuilder.CreateNavMeshData(option);
|
|
||||||
if (md != null)
|
|
||||||
{
|
|
||||||
meshData.Add(UpdateAreaAndFlags(md));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return meshData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,7 +34,7 @@ namespace DotRecast.Recast.DemoTool.Geom
|
||||||
private readonly RcVec3f bmin;
|
private readonly RcVec3f bmin;
|
||||||
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<DemoOffMeshConnection> offMeshConnections = new List<DemoOffMeshConnection>();
|
private readonly List<DemoOffMeshConnection> _offMeshConnections = new List<DemoOffMeshConnection>();
|
||||||
private readonly RcTriMesh _mesh;
|
private readonly RcTriMesh _mesh;
|
||||||
|
|
||||||
public DemoInputGeomProvider(List<float> vertexPositions, List<int> meshFaces) :
|
public DemoInputGeomProvider(List<float> vertexPositions, List<int> meshFaces) :
|
||||||
|
@ -134,18 +134,18 @@ namespace DotRecast.Recast.DemoTool.Geom
|
||||||
|
|
||||||
public List<DemoOffMeshConnection> GetOffMeshConnections()
|
public List<DemoOffMeshConnection> 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 DemoOffMeshConnection(start, end, radius, bidir, area, flags));
|
_offMeshConnections.Add(new DemoOffMeshConnection(start, end, radius, bidir, area, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveOffMeshConnections(Predicate<DemoOffMeshConnection> filter)
|
public void RemoveOffMeshConnections(Predicate<DemoOffMeshConnection> 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 : 확인 필요
|
||||||
}
|
}
|
||||||
|
|
||||||
public float? RaycastMesh(RcVec3f src, RcVec3f dst)
|
public float? RaycastMesh(RcVec3f src, RcVec3f dst)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using DotRecast.Core;
|
using DotRecast.Core;
|
||||||
using DotRecast.Recast.DemoTool.Builder;
|
using DotRecast.Recast.DemoTool.Builder;
|
||||||
using DotRecast.Recast.DemoTool.Geom;
|
using DotRecast.Recast.DemoTool.Geom;
|
||||||
|
using DotRecast.Recast.Geom;
|
||||||
|
|
||||||
namespace DotRecast.Recast.DemoTool.Tools
|
namespace DotRecast.Recast.DemoTool.Tools
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using DotRecast.Core;
|
using DotRecast.Core;
|
||||||
|
using DotRecast.Detour.TileCache;
|
||||||
|
|
||||||
namespace DotRecast.Recast.DemoTool.Tools
|
namespace DotRecast.Recast.DemoTool.Tools
|
||||||
{
|
{
|
||||||
|
@ -38,7 +39,7 @@ namespace DotRecast.Recast.DemoTool.Tools
|
||||||
int ty = (int)((pos.z - bmin[2]) / ts);
|
int ty = (int)((pos.z - bmin[2]) / ts);
|
||||||
|
|
||||||
var tileRef = navMesh.GetTileRefAt(tx, ty, 0);
|
var tileRef = navMesh.GetTileRefAt(tx, ty, 0);
|
||||||
navMesh.RemoveTile(tileRef);
|
// navMesh.RemoveTile(tileRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveTile(RcVec3f pos)
|
public void RemoveTile(RcVec3f pos)
|
||||||
|
|
|
@ -93,10 +93,12 @@ public class TestDetourBuilder : DetourBuilder
|
||||||
option.ch = rcConfig.ch;
|
option.ch = rcConfig.ch;
|
||||||
option.buildBvTree = true;
|
option.buildBvTree = true;
|
||||||
/*
|
/*
|
||||||
* option.offMeshConVerts = m_geom->GetOffMeshConnectionVerts(); option.offMeshConRad =
|
* option.offMeshConVerts = m_geom->GetOffMeshConnectionVerts();
|
||||||
* m_geom->GetOffMeshConnectionRads(); option.offMeshConDir = m_geom->GetOffMeshConnectionDirs();
|
* option.offMeshConRad = m_geom->GetOffMeshConnectionRads();
|
||||||
* option.offMeshConAreas = m_geom->GetOffMeshConnectionAreas(); option.offMeshConFlags =
|
* option.offMeshConDir = m_geom->GetOffMeshConnectionDirs();
|
||||||
* m_geom->GetOffMeshConnectionFlags(); option.offMeshConUserID = m_geom->GetOffMeshConnectionId();
|
* option.offMeshConAreas = m_geom->GetOffMeshConnectionAreas();
|
||||||
|
* option.offMeshConFlags = m_geom->GetOffMeshConnectionFlags();
|
||||||
|
* option.offMeshConUserID = m_geom->GetOffMeshConnectionId();
|
||||||
* option.offMeshConCount = m_geom->GetOffMeshConnectionCount();
|
* option.offMeshConCount = m_geom->GetOffMeshConnectionCount();
|
||||||
*/
|
*/
|
||||||
return option;
|
return option;
|
||||||
|
|
Loading…
Reference in New Issue