forked from bit/DotRecastNetSim
[Upstream] Typo fixes (recastnavigation #660)
This commit is contained in:
parent
cbc240ccb5
commit
da8bac596a
|
@ -20,3 +20,6 @@ dotnet_sort_system_directives_first = true
|
||||||
csharp_preserve_single_line_statements = false
|
csharp_preserve_single_line_statements = false
|
||||||
csharp_preserve_single_line_blocks = true
|
csharp_preserve_single_line_blocks = true
|
||||||
|
|
||||||
|
#
|
||||||
|
resharper_csharp_space_before_trailing_comment = true
|
||||||
|
resharper_csharp_space_after_operator_keyword = true
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace DotRecast.Detour.Crowd
|
||||||
* @var dtCrowdAgentParams::pathOptimizationRange
|
* @var dtCrowdAgentParams::pathOptimizationRange
|
||||||
* @par
|
* @par
|
||||||
*
|
*
|
||||||
* Only applicalbe if #updateFlags includes the #DT_CROWD_OPTIMIZE_VIS flag.
|
* Only applicable if #updateFlags includes the #DT_CROWD_OPTIMIZE_VIS flag.
|
||||||
*
|
*
|
||||||
* This value is often based on the agent radius. E.g. radius * 30
|
* This value is often based on the agent radius. E.g. radius * 30
|
||||||
*
|
*
|
||||||
|
@ -235,7 +235,7 @@ namespace DotRecast.Detour.Crowd
|
||||||
* @param pos
|
* @param pos
|
||||||
* The requested position of the agent. [(x, y, z)]
|
* The requested position of the agent. [(x, y, z)]
|
||||||
* @param params
|
* @param params
|
||||||
* The configutation of the agent.
|
* The configuration of the agent.
|
||||||
* @return The newly created agent object
|
* @return The newly created agent object
|
||||||
*/
|
*/
|
||||||
public DtCrowdAgent AddAgent(RcVec3f pos, DtCrowdAgentParams option)
|
public DtCrowdAgent AddAgent(RcVec3f pos, DtCrowdAgentParams option)
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace DotRecast.Detour.Crowd
|
||||||
float vcpen = m_params.weightCurVel * (RcVec3f.Dist2D(vcand, vel) * m_invVmax);
|
float vcpen = m_params.weightCurVel * (RcVec3f.Dist2D(vcand, vel) * m_invVmax);
|
||||||
|
|
||||||
// find the threshold hit time to bail out based on the early out penalty
|
// find the threshold hit time to bail out based on the early out penalty
|
||||||
// (see how the penalty is calculated below to understnad)
|
// (see how the penalty is calculated below to understand)
|
||||||
float minPen = minPenalty - vpen - vcpen;
|
float minPen = minPenalty - vpen - vcpen;
|
||||||
float tThresold = (m_params.weightToi / minPen - 0.1f) * m_params.horizTime;
|
float tThresold = (m_params.weightToi / minPen - 0.1f) * m_params.horizTime;
|
||||||
if (tThresold - m_params.horizTime > -float.MinValue)
|
if (tThresold - m_params.horizTime > -float.MinValue)
|
||||||
|
|
|
@ -1005,7 +1005,7 @@ namespace DotRecast.Detour.TileCache
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns T iff (a,b,c) are collinear and point c lies
|
// Returns T iff (a,b,c) are collinear and point c lies
|
||||||
// on the closed segement ab.
|
// on the closed segment ab.
|
||||||
private bool Between(int[] verts, int a, int b, int c)
|
private bool Between(int[] verts, int a, int b, int c)
|
||||||
{
|
{
|
||||||
if (!Collinear(verts, a, b, c))
|
if (!Collinear(verts, a, b, c))
|
||||||
|
|
|
@ -345,7 +345,7 @@ namespace DotRecast.Detour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Off-mesh connectionss are stored as polygons, adjust values.
|
// Off-mesh connections are stored as polygons, adjust values.
|
||||||
int totPolyCount = option.polyCount + storedOffMeshConCount;
|
int totPolyCount = option.polyCount + storedOffMeshConCount;
|
||||||
int totVertCount = option.vertCount + storedOffMeshConCount * 2;
|
int totVertCount = option.vertCount + storedOffMeshConCount * 2;
|
||||||
|
|
||||||
|
|
|
@ -23,52 +23,34 @@ using DotRecast.Core;
|
||||||
namespace DotRecast.Detour
|
namespace DotRecast.Detour
|
||||||
{
|
{
|
||||||
/// Represents the source data used to build an navigation mesh tile.
|
/// Represents the source data used to build an navigation mesh tile.
|
||||||
|
/// @ingroup detour
|
||||||
public class DtNavMeshCreateParams
|
public class DtNavMeshCreateParams
|
||||||
{
|
{
|
||||||
/// @name Polygon Mesh Attributes
|
/// @name Polygon Mesh Attributes
|
||||||
/// Used to create the base navigation graph.
|
/// Used to create the base navigation graph.
|
||||||
/// See #rcPolyMesh for details related to these attributes.
|
/// See #rcPolyMesh for details related to these attributes.
|
||||||
/// @{
|
/// @{
|
||||||
public int[] verts;
|
public int[] verts; // < The polygon mesh vertices. [(x, y, z) * #vertCount] [Unit: vx]
|
||||||
|
|
||||||
/// < The polygon mesh vertices. [(x, y, z) * #vertCount] [Unit: vx]
|
public int vertCount; // < The number vertices in the polygon mesh. [Limit: >= 3]
|
||||||
public int vertCount;
|
public int[] polys; // < The polygon data. [Size: #polyCount * 2 * #nvp]
|
||||||
|
public int[] polyFlags; // < The user defined flags assigned to each polygon. [Size: #polyCount]
|
||||||
|
public int[] polyAreas; // < The user defined area ids assigned to each polygon. [Size: #polyCount]
|
||||||
|
public int polyCount; // < Number of polygons in the mesh. [Limit: >= 1]
|
||||||
|
public int nvp; // < Number maximum number of vertices per polygon. [Limit: >= 3]
|
||||||
|
|
||||||
/// < The number vertices in the polygon mesh. [Limit: >= 3]
|
|
||||||
public int[] polys;
|
|
||||||
|
|
||||||
/// < The polygon data. [Size: #polyCount * 2 * #nvp]
|
|
||||||
public int[] polyFlags;
|
|
||||||
|
|
||||||
/// < The user defined flags assigned to each polygon. [Size: #polyCount]
|
|
||||||
public int[] polyAreas;
|
|
||||||
|
|
||||||
/// < The user defined area ids assigned to each polygon. [Size: #polyCount]
|
|
||||||
public int polyCount;
|
|
||||||
|
|
||||||
/// < Number of polygons in the mesh. [Limit: >= 1]
|
|
||||||
public int nvp;
|
|
||||||
|
|
||||||
/// < Number maximum number of vertices per polygon. [Limit: >= 3]
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Height Detail Attributes (Optional)
|
/// @name Height Detail Attributes (Optional)
|
||||||
/// See #rcPolyMeshDetail for details related to these attributes.
|
/// See #rcPolyMeshDetail for details related to these attributes.
|
||||||
/// @{
|
/// @{
|
||||||
public int[] detailMeshes;
|
///
|
||||||
|
public int[] detailMeshes; // < The height detail sub-mesh data. [Size: 4 * #polyCount]
|
||||||
|
|
||||||
/// < The height detail sub-mesh data. [Size: 4 * #polyCount]
|
public float[] detailVerts; // < The detail mesh vertices. [Size: 3 * #detailVertsCount] [Unit: wu]
|
||||||
public float[] detailVerts;
|
public int detailVertsCount; // < The number of vertices in the detail mesh.
|
||||||
|
public int[] detailTris; // < The detail mesh triangles. [Size: 4 * #detailTriCount]
|
||||||
|
public int detailTriCount; // < The number of triangles in the detail mesh.
|
||||||
|
|
||||||
/// < The detail mesh vertices. [Size: 3 * #detailVertsCount] [Unit: wu]
|
|
||||||
public int detailVertsCount;
|
|
||||||
|
|
||||||
/// < The number of vertices in the detail mesh.
|
|
||||||
public int[] detailTris;
|
|
||||||
|
|
||||||
/// < The detail mesh triangles. [Size: 4 * #detailTriCount]
|
|
||||||
public int detailTriCount;
|
|
||||||
|
|
||||||
/// < The number of triangles in the detail mesh.
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Off-Mesh Connections Attributes (Optional)
|
/// @name Off-Mesh Connections Attributes (Optional)
|
||||||
/// Used to define a custom point-to-point edge within the navigation graph, an
|
/// Used to define a custom point-to-point edge within the navigation graph, an
|
||||||
|
@ -103,24 +85,14 @@ namespace DotRecast.Detour
|
||||||
/// @name Tile Attributes
|
/// @name Tile Attributes
|
||||||
/// @note The tile grid/layer data can be left at zero if the destination is a single tile mesh.
|
/// @note The tile grid/layer data can be left at zero if the destination is a single tile mesh.
|
||||||
/// @{
|
/// @{
|
||||||
public int userId;
|
public int userId; // < The user defined id of the tile.
|
||||||
|
|
||||||
/// < The user defined id of the tile.
|
public int tileX; // < The tile's x-grid location within the multi-tile destination mesh. (Along the x-axis.)
|
||||||
public int tileX;
|
public int tileZ; // < The tile's y-grid location within the multi-tile destination mesh. (Along the z-axis.)
|
||||||
|
public int tileLayer; // < The tile's layer within the layered destination mesh. [Limit: >= 0] (Along the y-axis.)
|
||||||
|
public RcVec3f bmin; // < The minimum bounds of the tile. [(x, y, z)] [Unit: wu]
|
||||||
|
public RcVec3f bmax; // < The maximum bounds of the tile. [(x, y, z)] [Unit: wu]
|
||||||
|
|
||||||
/// < The tile's x-grid location within the multi-tile destination mesh. (Along the x-axis.)
|
|
||||||
public int tileZ;
|
|
||||||
|
|
||||||
/// < The tile's y-grid location within the multi-tile desitation mesh. (Along the z-axis.)
|
|
||||||
public int tileLayer;
|
|
||||||
|
|
||||||
/// < The tile's layer within the layered destination mesh. [Limit: >= 0] (Along the y-axis.)
|
|
||||||
public RcVec3f bmin;
|
|
||||||
|
|
||||||
/// < The minimum bounds of the tile. [(x, y, z)] [Unit: wu]
|
|
||||||
public RcVec3f bmax;
|
|
||||||
|
|
||||||
/// < The maximum bounds of the tile. [(x, y, z)] [Unit: wu]
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name General Configuration Attributes
|
/// @name General Configuration Attributes
|
||||||
/// @{
|
/// @{
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace DotRecast.Detour
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Choose random tile using reservoi sampling.
|
// Choose random tile using reservoir sampling.
|
||||||
float area = 1.0f; // Could be tile area too.
|
float area = 1.0f; // Could be tile area too.
|
||||||
tsum += area;
|
tsum += area;
|
||||||
float u = frand.Next();
|
float u = frand.Next();
|
||||||
|
@ -145,7 +145,7 @@ namespace DotRecast.Detour
|
||||||
polyArea += DtUtils.TriArea2D(tile.data.verts, va, vb, vc);
|
polyArea += DtUtils.TriArea2D(tile.data.verts, va, vb, vc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Choose random polygon weighted by area, using reservoi sampling.
|
// Choose random polygon weighted by area, using reservoir sampling.
|
||||||
areaSum += polyArea;
|
areaSum += polyArea;
|
||||||
float u = frand.Next();
|
float u = frand.Next();
|
||||||
if (u * areaSum <= polyArea)
|
if (u * areaSum <= polyArea)
|
||||||
|
@ -271,7 +271,7 @@ namespace DotRecast.Detour
|
||||||
bestNode.flags &= ~DT_NODE_OPEN;
|
bestNode.flags &= ~DT_NODE_OPEN;
|
||||||
bestNode.flags |= DT_NODE_CLOSED;
|
bestNode.flags |= DT_NODE_CLOSED;
|
||||||
// Get poly and tile.
|
// Get poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long bestRef = bestNode.id;
|
long bestRef = bestNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ namespace DotRecast.Detour
|
||||||
polyArea += DtUtils.TriArea2D(constrainedVerts, va, vb, vc);
|
polyArea += DtUtils.TriArea2D(constrainedVerts, va, vb, vc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Choose random polygon weighted by area, using reservoi sampling.
|
// Choose random polygon weighted by area, using reservoir sampling.
|
||||||
areaSum += polyArea;
|
areaSum += polyArea;
|
||||||
float u = frand.Next();
|
float u = frand.Next();
|
||||||
if (u * areaSum <= polyArea)
|
if (u * areaSum <= polyArea)
|
||||||
|
@ -752,7 +752,7 @@ namespace DotRecast.Detour
|
||||||
* The start and end positions are used to calculate traversal costs. (The y-values impact the result.)
|
* The start and end positions are used to calculate traversal costs. (The y-values impact the result.)
|
||||||
*
|
*
|
||||||
* @param startRef
|
* @param startRef
|
||||||
* The refrence id of the start polygon.
|
* The reference id of the start polygon.
|
||||||
* @param endRef
|
* @param endRef
|
||||||
* The reference id of the end polygon.
|
* The reference id of the end polygon.
|
||||||
* @param startPos
|
* @param startPos
|
||||||
|
@ -829,7 +829,7 @@ namespace DotRecast.Detour
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current poly and tile.
|
// Get current poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long bestRef = bestNode.id;
|
long bestRef = bestNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ namespace DotRecast.Detour
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get neighbour poly and tile.
|
// Get neighbour poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(neighbourRef, out var neighbourTile, out var neighbourPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(neighbourRef, out var neighbourTile, out var neighbourPoly);
|
||||||
|
|
||||||
if (!filter.PassFilter(neighbourRef, neighbourTile, neighbourPoly))
|
if (!filter.PassFilter(neighbourRef, neighbourTile, neighbourPoly))
|
||||||
|
@ -1130,7 +1130,7 @@ namespace DotRecast.Detour
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current poly and tile.
|
// Get current poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal
|
// The API input has been checked already, skip checking internal
|
||||||
// data.
|
// data.
|
||||||
long bestRef = bestNode.id;
|
long bestRef = bestNode.id;
|
||||||
var status = m_nav.GetTileAndPolyByRef(bestRef, out var bestTile, out var bestPoly);
|
var status = m_nav.GetTileAndPolyByRef(bestRef, out var bestTile, out var bestPoly);
|
||||||
|
@ -1194,7 +1194,7 @@ namespace DotRecast.Detour
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get neighbour poly and tile.
|
// Get neighbour poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal
|
// The API input has been checked already, skip checking internal
|
||||||
// data.
|
// data.
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(neighbourRef, out var neighbourTile, out var neighbourPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(neighbourRef, out var neighbourTile, out var neighbourPoly);
|
||||||
|
|
||||||
|
@ -1840,7 +1840,7 @@ namespace DotRecast.Detour
|
||||||
stack.RemoveFirst();
|
stack.RemoveFirst();
|
||||||
|
|
||||||
// Get poly and tile.
|
// Get poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long curRef = curNode.id;
|
long curRef = curNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(curRef, out var curTile, out var curPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(curRef, out var curTile, out var curPoly);
|
||||||
|
|
||||||
|
@ -2490,7 +2490,7 @@ namespace DotRecast.Detour
|
||||||
bestNode.flags |= DtNode.DT_NODE_CLOSED;
|
bestNode.flags |= DtNode.DT_NODE_CLOSED;
|
||||||
|
|
||||||
// Get poly and tile.
|
// Get poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long bestRef = bestNode.id;
|
long bestRef = bestNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
||||||
|
|
||||||
|
@ -2667,7 +2667,7 @@ namespace DotRecast.Detour
|
||||||
bestNode.flags |= DtNode.DT_NODE_CLOSED;
|
bestNode.flags |= DtNode.DT_NODE_CLOSED;
|
||||||
|
|
||||||
// Get poly and tile.
|
// Get poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long bestRef = bestNode.id;
|
long bestRef = bestNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
||||||
|
|
||||||
|
@ -2840,7 +2840,7 @@ namespace DotRecast.Detour
|
||||||
stack.RemoveFirst();
|
stack.RemoveFirst();
|
||||||
|
|
||||||
// Get poly and tile.
|
// Get poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long curRef = curNode.id;
|
long curRef = curNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(curRef, out var curTile, out var curPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(curRef, out var curTile, out var curPoly);
|
||||||
|
|
||||||
|
@ -3170,7 +3170,7 @@ namespace DotRecast.Detour
|
||||||
bestNode.flags |= DtNode.DT_NODE_CLOSED;
|
bestNode.flags |= DtNode.DT_NODE_CLOSED;
|
||||||
|
|
||||||
// Get poly and tile.
|
// Get poly and tile.
|
||||||
// The API input has been cheked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
long bestRef = bestNode.id;
|
long bestRef = bestNode.id;
|
||||||
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
m_nav.GetTileAndPolyByRefUnsafe(bestRef, out var bestTile, out var bestPoly);
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ namespace DotRecast.Detour
|
||||||
*/
|
*/
|
||||||
public class DtQueryDefaultFilter : IDtQueryFilter
|
public class DtQueryDefaultFilter : IDtQueryFilter
|
||||||
{
|
{
|
||||||
private int m_excludeFlags;
|
private readonly float[] m_areaCost = new float[DtNavMesh.DT_MAX_AREAS]; //< Cost per area type. (Used by default implementation.)
|
||||||
private int m_includeFlags;
|
private int m_includeFlags; //< Flags for polygons that can be visited. (Used by default implementation.)
|
||||||
private readonly float[] m_areaCost = new float[DtNavMesh.DT_MAX_AREAS];
|
private int m_excludeFlags; //< Flags for polygons that should not be visited. (Used by default implementation.)
|
||||||
|
|
||||||
public DtQueryDefaultFilter()
|
public DtQueryDefaultFilter()
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,6 @@ namespace DotRecast.Detour
|
||||||
|
|
||||||
private DtQueryNoOpFilter()
|
private DtQueryNoOpFilter()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PassFilter(long refs, DtMeshTile tile, DtPoly poly)
|
public bool PassFilter(long refs, DtMeshTile tile, DtPoly poly)
|
||||||
|
|
|
@ -174,7 +174,7 @@ namespace DotRecast.Recast
|
||||||
|
|
||||||
// Partition the heightfield so that we can use simple algorithm later
|
// Partition the heightfield so that we can use simple algorithm later
|
||||||
// to triangulate the walkable areas.
|
// to triangulate the walkable areas.
|
||||||
// There are 3 martitioning methods, each with some pros and cons:
|
// There are 3 partitioning methods, each with some pros and cons:
|
||||||
// 1) Watershed partitioning
|
// 1) Watershed partitioning
|
||||||
// - the classic Recast partitioning
|
// - the classic Recast partitioning
|
||||||
// - creates the nicest tessellation
|
// - creates the nicest tessellation
|
||||||
|
@ -187,7 +187,7 @@ namespace DotRecast.Recast
|
||||||
// (triangulation can handle this)
|
// (triangulation can handle this)
|
||||||
// - overlaps may occur if you have narrow spiral corridors (i.e
|
// - overlaps may occur if you have narrow spiral corridors (i.e
|
||||||
// stairs), this make triangulation to fail
|
// stairs), this make triangulation to fail
|
||||||
// * generally the best choice if you precompute the nacmesh, use this
|
// * generally the best choice if you precompute the navmesh, use this
|
||||||
// if you have large open areas
|
// if you have large open areas
|
||||||
// 2) Monotone partioning
|
// 2) Monotone partioning
|
||||||
// - fastest
|
// - fastest
|
||||||
|
|
|
@ -407,7 +407,7 @@ namespace DotRecast.Recast
|
||||||
if (dx * dx + dz * dz > maxEdgeLen * maxEdgeLen)
|
if (dx * dx + dz * dz > maxEdgeLen * maxEdgeLen)
|
||||||
{
|
{
|
||||||
// Round based on the segments in lexilogical order so that the
|
// Round based on the segments in lexilogical order so that the
|
||||||
// max tesselation is consistent regardles in which direction
|
// max tesselation is consistent regardless in which direction
|
||||||
// segments are traversed.
|
// segments are traversed.
|
||||||
int n = bi < ai ? (bi + pn - ai) : (bi - ai);
|
int n = bi < ai ? (bi + pn - ai) : (bi - ai);
|
||||||
if (n > 1)
|
if (n > 1)
|
||||||
|
@ -643,7 +643,7 @@ namespace DotRecast.Recast
|
||||||
for (int iter = 0; iter < hole.nverts; iter++)
|
for (int iter = 0; iter < hole.nverts; iter++)
|
||||||
{
|
{
|
||||||
// Find potential diagonals.
|
// Find potential diagonals.
|
||||||
// The 'best' vertex must be in the cone described by 3 cosequtive vertices of the outline.
|
// The 'best' vertex must be in the cone described by 3 consecutive vertices of the outline.
|
||||||
// ..o j-1
|
// ..o j-1
|
||||||
// |
|
// |
|
||||||
// | * best
|
// | * best
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace DotRecast.Recast
|
||||||
/// Allows the formation of walkable regions that will flow over low lying
|
/// Allows the formation of walkable regions that will flow over low lying
|
||||||
/// objects such as curbs, and up structures such as stairways.
|
/// objects such as curbs, and up structures such as stairways.
|
||||||
///
|
///
|
||||||
/// Two neighboring spans are walkable if: <tt>RcAbs(currentSpan.smax - neighborSpan.smax) < waklableClimb</tt>
|
/// Two neighboring spans are walkable if: <tt>RcAbs(currentSpan.smax - neighborSpan.smax) < walkableClimb</tt>
|
||||||
///
|
///
|
||||||
/// @warning Will override the effect of #rcFilterLedgeSpans. So if both filters are used, call
|
/// @warning Will override the effect of #rcFilterLedgeSpans. So if both filters are used, call
|
||||||
/// #rcFilterLedgeSpans after calling this filter.
|
/// #rcFilterLedgeSpans after calling this filter.
|
||||||
|
|
|
@ -199,7 +199,7 @@ namespace DotRecast.Recast
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns T iff (a,b,c) are collinear and point c lies
|
// Returns T iff (a,b,c) are collinear and point c lies
|
||||||
// on the closed segement ab.
|
// on the closed segment ab.
|
||||||
private static bool Between(int[] verts, int a, int b, int c)
|
private static bool Between(int[] verts, int a, int b, int c)
|
||||||
{
|
{
|
||||||
if (!Collinear(verts, a, b, c))
|
if (!Collinear(verts, a, b, c))
|
||||||
|
@ -961,7 +961,7 @@ namespace DotRecast.Recast
|
||||||
/// @par
|
/// @par
|
||||||
///
|
///
|
||||||
/// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper
|
/// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper
|
||||||
/// limit must be retricted to <= #DT_VERTS_PER_POLYGON.
|
/// limit must be restricted to <= #DT_VERTS_PER_POLYGON.
|
||||||
///
|
///
|
||||||
/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
|
/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
|
||||||
public static RcPolyMesh BuildPolyMesh(RcTelemetry ctx, RcContourSet cset, int nvp)
|
public static RcPolyMesh BuildPolyMesh(RcTelemetry ctx, RcContourSet cset, int nvp)
|
||||||
|
|
|
@ -787,8 +787,8 @@ namespace DotRecast.Recast
|
||||||
|
|
||||||
// Triangulate the polygon by moving left or right,
|
// Triangulate the polygon by moving left or right,
|
||||||
// depending on which triangle has shorter perimeter.
|
// depending on which triangle has shorter perimeter.
|
||||||
// This heuristic was chose emprically, since it seems
|
// This heuristic was chose empirically, since it seems
|
||||||
// handle tesselated straight edges well.
|
// handle tessellated straight edges well.
|
||||||
while (RecastMesh.Next(left, nhull) != right)
|
while (RecastMesh.Next(left, nhull) != right)
|
||||||
{
|
{
|
||||||
// Check to see if se should advance left or right.
|
// Check to see if se should advance left or right.
|
||||||
|
|
|
@ -1466,7 +1466,7 @@ namespace DotRecast.Recast
|
||||||
/// re-assigned to the zero (null) region.
|
/// re-assigned to the zero (null) region.
|
||||||
///
|
///
|
||||||
/// Partitioning can result in smaller than necessary regions. @p mergeRegionArea helps
|
/// Partitioning can result in smaller than necessary regions. @p mergeRegionArea helps
|
||||||
/// reduce unecessarily small regions.
|
/// reduce unnecessarily small regions.
|
||||||
///
|
///
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
|
@ -1645,7 +1645,7 @@ namespace DotRecast.Recast
|
||||||
/// re-assigned to the zero (null) region.
|
/// re-assigned to the zero (null) region.
|
||||||
///
|
///
|
||||||
/// Watershed partitioning can result in smaller than necessary regions, especially in diagonal corridors.
|
/// Watershed partitioning can result in smaller than necessary regions, especially in diagonal corridors.
|
||||||
/// @p mergeRegionArea helps reduce unecessarily small regions.
|
/// @p mergeRegionArea helps reduce unnecessarily small regions.
|
||||||
///
|
///
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
|
@ -1759,7 +1759,7 @@ namespace DotRecast.Recast
|
||||||
|
|
||||||
ctx.StartTimer(RcTimerLabel.RC_TIMER_BUILD_REGIONS_FILTER);
|
ctx.StartTimer(RcTimerLabel.RC_TIMER_BUILD_REGIONS_FILTER);
|
||||||
|
|
||||||
// Merge regions and filter out smalle regions.
|
// Merge regions and filter out small regions.
|
||||||
List<int> overlaps = new List<int>();
|
List<int> overlaps = new List<int>();
|
||||||
chf.maxRegions = MergeAndFilterRegions(ctx, minRegionArea, mergeRegionArea, regionId, chf, srcReg, overlaps);
|
chf.maxRegions = MergeAndFilterRegions(ctx, minRegionArea, mergeRegionArea, regionId, chf, srcReg, overlaps);
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class RecastSoloMeshTest
|
||||||
|
|
||||||
// Partition the heightfield so that we can use simple algorithm later
|
// Partition the heightfield so that we can use simple algorithm later
|
||||||
// to triangulate the walkable areas.
|
// to triangulate the walkable areas.
|
||||||
// There are 3 martitioning methods, each with some pros and cons:
|
// There are 3 partitioning methods, each with some pros and cons:
|
||||||
// 1) Watershed partitioning
|
// 1) Watershed partitioning
|
||||||
// - the classic Recast partitioning
|
// - the classic Recast partitioning
|
||||||
// - creates the nicest tessellation
|
// - creates the nicest tessellation
|
||||||
|
@ -182,7 +182,7 @@ public class RecastSoloMeshTest
|
||||||
// (triangulation can handle this)
|
// (triangulation can handle this)
|
||||||
// - overlaps may occur if you have narrow spiral corridors (i.e
|
// - overlaps may occur if you have narrow spiral corridors (i.e
|
||||||
// stairs), this make triangulation to fail
|
// stairs), this make triangulation to fail
|
||||||
// * generally the best choice if you precompute the nacmesh, use this
|
// * generally the best choice if you precompute the navmesh, use this
|
||||||
// if you have large open areas
|
// if you have large open areas
|
||||||
// 2) Monotone partioning
|
// 2) Monotone partioning
|
||||||
// - fastest
|
// - fastest
|
||||||
|
|
Loading…
Reference in New Issue