forked from mirror/DotRecast
refactor: Move constants from class DtNavMesh to class DtDetailTriEdgeFlags
- moved constraints DT_DETAIL_EDGE_BOUNDARY
This commit is contained in:
parent
542f2bf5d1
commit
26387de859
|
@ -0,0 +1,7 @@
|
|||
namespace DotRecast.Detour
|
||||
{
|
||||
public static class DtDetailTriEdgeFlags
|
||||
{
|
||||
public const int DT_DETAIL_EDGE_BOUNDARY = 0x01;
|
||||
}
|
||||
}
|
|
@ -24,14 +24,11 @@ using DotRecast.Core;
|
|||
|
||||
namespace DotRecast.Detour
|
||||
{
|
||||
|
||||
|
||||
public class DtNavMesh
|
||||
{
|
||||
public const int DT_SALT_BITS = 16;
|
||||
public const int DT_TILE_BITS = 28;
|
||||
public const int DT_POLY_BITS = 20;
|
||||
public const int DT_DETAIL_EDGE_BOUNDARY = 0x01;
|
||||
|
||||
/// A flag that indicates that an entity links to an external entity.
|
||||
/// (E.g. A polygon edge is a portal that links to another polygon.)
|
||||
|
@ -1128,8 +1125,9 @@ namespace DotRecast.Detour
|
|||
*/
|
||||
RcVec3f ClosestPointOnDetailEdges(DtMeshTile tile, DtPoly poly, RcVec3f pos, bool onlyBoundary)
|
||||
{
|
||||
int ANY_BOUNDARY_EDGE = (DT_DETAIL_EDGE_BOUNDARY << 0) | (DT_DETAIL_EDGE_BOUNDARY << 2)
|
||||
| (DT_DETAIL_EDGE_BOUNDARY << 4);
|
||||
int ANY_BOUNDARY_EDGE = (DtDetailTriEdgeFlags.DT_DETAIL_EDGE_BOUNDARY << 0) |
|
||||
(DtDetailTriEdgeFlags.DT_DETAIL_EDGE_BOUNDARY << 2) |
|
||||
(DtDetailTriEdgeFlags.DT_DETAIL_EDGE_BOUNDARY << 4);
|
||||
int ip = poly.index;
|
||||
float dmin = float.MaxValue;
|
||||
float tmin = 0;
|
||||
|
@ -1175,7 +1173,7 @@ namespace DotRecast.Detour
|
|||
|
||||
for (int k = 0, j = 2; k < 3; j = k++)
|
||||
{
|
||||
if ((GetDetailTriEdgeFlags(tris[ti + 3], j) & DT_DETAIL_EDGE_BOUNDARY) == 0
|
||||
if ((GetDetailTriEdgeFlags(tris[ti + 3], j) & DtDetailTriEdgeFlags.DT_DETAIL_EDGE_BOUNDARY) == 0
|
||||
&& (onlyBoundary || tris[ti + j] < tris[ti + k]))
|
||||
{
|
||||
// Only looking at boundary edges and this is internal, or
|
||||
|
|
|
@ -395,7 +395,7 @@ public class RecastDebugDraw : DebugDraw
|
|||
|
||||
for (int m = 0, n = 2; m < 3; n = m++)
|
||||
{
|
||||
if ((DtNavMesh.GetDetailTriEdgeFlags(tile.data.detailTris[t + 3], n) & DtNavMesh.DT_DETAIL_EDGE_BOUNDARY) == 0)
|
||||
if ((DtNavMesh.GetDetailTriEdgeFlags(tile.data.detailTris[t + 3], n) & DtDetailTriEdgeFlags.DT_DETAIL_EDGE_BOUNDARY) == 0)
|
||||
continue;
|
||||
|
||||
if (((tile.data.detailTris[t + 3] >> (n * 2)) & 0x3) == 0)
|
||||
|
|
Loading…
Reference in New Issue