Recast: ignore off-mesh links for traverse links

Do not link or union off-mesh links to traverse links.
This commit is contained in:
Kawe Mazidjatari 2024-08-22 01:14:49 +02:00
parent cf6d3f3dcf
commit 739d590574
2 changed files with 9 additions and 7 deletions

View File

@ -794,6 +794,9 @@ void Editor::connectTileTraverseLinks(dtMeshTile* const baseTile, const bool lin
if (basePoly->groupId == DT_UNLINKED_POLY_GROUP)
continue;
if (basePoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION)
continue;
for (int j = 0; j < basePoly->vertCount; ++j)
{
// Hard edges only!
@ -868,6 +871,9 @@ void Editor::connectTileTraverseLinks(dtMeshTile* const baseTile, const bool lin
if (landPoly->groupId == DT_UNLINKED_POLY_GROUP)
continue;
if (landPoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION)
continue;
for (int m = 0; m < landPoly->vertCount; ++m)
{
if (landPoly->neis[m] != 0)

View File

@ -426,6 +426,9 @@ static void unionTraverseLinkedPolyGroups(const dtTraverseTableCreateParams* par
{
dtPoly& poly = tile->polys[j];
if (poly.getType() == DT_POLYTYPE_OFFMESH_CONNECTION)
continue;
for (int k = poly.firstLink; k != DT_NULL_LINK; k = tile->links[k].next)
{
const dtLink* link = &tile->links[k];
@ -434,13 +437,6 @@ static void unionTraverseLinkedPolyGroups(const dtTraverseTableCreateParams* par
if (link->traverseType == DT_NULL_TRAVERSE_TYPE)
continue;
// note(amos): here we want to possible change several things up.
// Ideally we create a disjoint set for each anim type (5 for small,
// 1 for everything beyond) and determine the traversability here
// with use of a lookup table that has to be made still.
// Anim type 0 (HUMAN) for example, cannot jump as high as anim type
// 2 (STALKER).
const dtPoly* landPoly;
const dtMeshTile* landTile;