DtStraightPathFlags int to byte

This commit is contained in:
ikpil 2024-06-25 00:17:07 +09:00
parent e5d5867c56
commit 35f5c63d77
3 changed files with 13 additions and 8 deletions

View File

@ -1477,7 +1477,7 @@ namespace DotRecast.Detour
return DtStatus.DT_SUCCESS | details; return DtStatus.DT_SUCCESS | details;
} }
protected DtStatus AppendVertex(RcVec3f pos, int flags, long refs, Span<DtStraightPath> straightPath, ref int straightPathCount, int maxStraightPath) protected DtStatus AppendVertex(RcVec3f pos, byte flags, long refs, Span<DtStraightPath> straightPath, ref int straightPathCount, int maxStraightPath)
{ {
if (straightPathCount > 0 && RcVec.Equal(straightPath[straightPathCount - 1].pos, pos)) if (straightPathCount > 0 && RcVec.Equal(straightPath[straightPathCount - 1].pos, pos))
{ {
@ -1715,7 +1715,7 @@ namespace DotRecast.Detour
portalApex = portalLeft; portalApex = portalLeft;
apexIndex = leftIndex; apexIndex = leftIndex;
int flags = 0; byte flags = 0;
if (leftPolyRef == 0) if (leftPolyRef == 0)
{ {
flags = DtStraightPathFlags.DT_STRAIGHTPATH_END; flags = DtStraightPathFlags.DT_STRAIGHTPATH_END;
@ -1771,7 +1771,7 @@ namespace DotRecast.Detour
portalApex = portalRight; portalApex = portalRight;
apexIndex = rightIndex; apexIndex = rightIndex;
int flags = 0; byte flags = 0;
if (rightPolyRef == 0) if (rightPolyRef == 0)
{ {
flags = DtStraightPathFlags.DT_STRAIGHTPATH_END; flags = DtStraightPathFlags.DT_STRAIGHTPATH_END;

View File

@ -25,11 +25,16 @@ namespace DotRecast.Detour
//TODO: (PP) Add comments //TODO: (PP) Add comments
public readonly struct DtStraightPath public readonly struct DtStraightPath
{ {
/// The local path corridor corners for the agent. (Staight path.) [(x, y, z) * #ncorners]
public readonly RcVec3f pos; public readonly RcVec3f pos;
public readonly int flags;
/// The local path corridor corner flags. (See: #dtStraightPathFlags) [(flags) * #ncorners]
public readonly byte flags;
/// The reference id of the polygon being entered at the corner. [(polyRef) * #ncorners]
public readonly long refs; public readonly long refs;
public DtStraightPath(RcVec3f pos, int flags, long refs) public DtStraightPath(RcVec3f pos, byte flags, long refs)
{ {
this.pos = pos; this.pos = pos;
this.flags = flags; this.flags = flags;

View File

@ -3,8 +3,8 @@
/// Vertex flags returned by dtNavMeshQuery::findStraightPath. /// Vertex flags returned by dtNavMeshQuery::findStraightPath.
public static class DtStraightPathFlags public static class DtStraightPathFlags
{ {
public const int DT_STRAIGHTPATH_START = 0x01; //< The vertex is the start position in the path. public const byte DT_STRAIGHTPATH_START = 0x01; //< The vertex is the start position in the path.
public const int DT_STRAIGHTPATH_END = 0x02; //< The vertex is the end position in the path. public const byte DT_STRAIGHTPATH_END = 0x02; //< The vertex is the end position in the path.
public const int DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04; //< The vertex is the start of an off-mesh connection. public const byte DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04; //< The vertex is the start of an off-mesh connection.
} }
} }