Recast: update dtLink variable names and assignments

Light cleanup and added new names and documentation of what's currently know.
This commit is contained in:
Kawe Mazidjatari 2024-07-18 15:49:51 +02:00
parent 12f39f1c44
commit fce53b6eed
3 changed files with 22 additions and 22 deletions

View File

@ -179,7 +179,7 @@ static void drawTraverseLinks(duDebugDraw* dd, const dtNavMesh& mesh, const dtNa
dd->vertex(startPos, col);
dd->vertex(endPos, col);
const bool hasReverseLink = link->reverseLinkIndex != DT_NULL_TRAVERSE_REVERSE_LINK;
const bool hasReverseLink = link->reverseLink != DT_NULL_TRAVERSE_REVERSE_LINK;
if (hasReverseLink)
{

View File

@ -269,9 +269,9 @@ struct dtLink
unsigned char side; ///< If a boundary link, defines on which side the link is.
unsigned char bmin; ///< If a boundary link, defines the minimum sub-edge area.
unsigned char bmax; ///< If a boundary link, defines the maximum sub-edge area.
unsigned char jumpType;
unsigned char otherUnk;
unsigned short reverseLinkIndex;
unsigned char traverseType; ///< The traverse type for this link. (Jumping, climbing, etc.)
unsigned char traverseDist; ///< The traverse distance of this link. (Quantized by #DT_TRAVERSE_DIST_QUANT_FACTOR).
unsigned short reverseLink; ///< The reverse traversal link for this link. (Path returns through this link.)
};
/// Bounding volume node.

View File

@ -464,9 +464,9 @@ void dtNavMesh::connectExtLinks(dtMeshTile* tile, dtMeshTile* target, int side)
link->next = poly->firstLink;
poly->firstLink = idx;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
link->jumpType = DT_NULL_TRAVERSE_TYPE;
link->jumpDist = 0;
link->reverseLink = DT_NULL_TRAVERSE_REVERSE_LINK;
// Compress portal limits to a byte value.
if (dir == 0 || dir == 4)
@ -540,9 +540,9 @@ void dtNavMesh::connectExtOffMeshLinks(dtMeshTile* tile, dtMeshTile* target, int
// Add to linked list.
link->next = targetPoly->firstLink;
targetPoly->firstLink = idx;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
link->jumpType = DT_NULL_TRAVERSE_TYPE;
link->jumpDist = 0;
link->reverseLink = DT_NULL_TRAVERSE_REVERSE_LINK;
}
// Link target poly to off-mesh connection.
@ -563,9 +563,9 @@ void dtNavMesh::connectExtOffMeshLinks(dtMeshTile* tile, dtMeshTile* target, int
// Add to linked list.
tlink->next = landPoly->firstLink;
landPoly->firstLink = tidx;
tlink->jumpType = 0xFF;
tlink->otherUnk = 0;
tlink->reverseLinkIndex = 0xFFFF;
tlink->jumpType = DT_NULL_TRAVERSE_TYPE;
tlink->jumpDist = 0;
tlink->reverseLink = DT_NULL_TRAVERSE_REVERSE_LINK;
}
}
@ -612,9 +612,9 @@ void dtNavMesh::connectIntLinks(dtMeshTile* tile)
// Add to linked list.
link->next = poly->firstLink;
poly->firstLink = idx;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
link->jumpType = DT_NULL_TRAVERSE_TYPE;
link->jumpDist = 0;
link->reverseLink = DT_NULL_TRAVERSE_REVERSE_LINK;
}
}
}
@ -658,9 +658,9 @@ void dtNavMesh::baseOffMeshLinks(dtMeshTile* tile)
// Add to linked list.
link->next = poly->firstLink;
poly->firstLink = idx;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
link->jumpType = DT_NULL_TRAVERSE_TYPE;
link->jumpDist = 0;
link->reverseLink = DT_NULL_TRAVERSE_REVERSE_LINK;
}
// Start end-point is always connect back to off-mesh connection.
@ -677,9 +677,9 @@ void dtNavMesh::baseOffMeshLinks(dtMeshTile* tile)
// Add to linked list.
link->next = landPoly->firstLink;
landPoly->firstLink = tidx;
link->jumpType = 0xFF;
link->otherUnk = 0;
link->reverseLinkIndex = 0xFFFF;
link->jumpType = DT_NULL_TRAVERSE_TYPE;
link->jumpDist = 0;
link->reverseLink = DT_NULL_TRAVERSE_REVERSE_LINK;
}
}
}