Update recastnavigation lib to 1.6

This commit is contained in:
Wojtek Figat
2023-09-19 13:34:32 +02:00
parent 0083ebd887
commit bb5ff740bf
29 changed files with 1461 additions and 1275 deletions

View File

@@ -23,6 +23,15 @@
#include "DetourTileCacheBuilder.h"
#include <string.h>
dtTileCacheAlloc::~dtTileCacheAlloc()
{
// Defined out of line to fix the weak v-tables warning
}
dtTileCacheCompressor::~dtTileCacheCompressor()
{
// Defined out of line to fix the weak v-tables warning
}
template<class T> class dtFixedArray
{
@@ -881,7 +890,7 @@ static bool buildMeshAdjacency(dtTileCacheAlloc* alloc,
const dtTileCacheContourSet& lcset)
{
// Based on code by Eric Lengyel from:
// http://www.terathon.com/code/edges.php
// https://web.archive.org/web/20080704083314/http://www.terathon.com/code/edges.php
const int maxEdgeCount = npolys*MAX_VERTS_PER_POLY;
dtFixedArray<unsigned short> firstEdge(alloc, nverts + maxEdgeCount);
@@ -1399,7 +1408,6 @@ static void pushBack(unsigned short v, unsigned short* arr, int& an)
static bool canRemoveVertex(dtTileCachePolyMesh& mesh, const unsigned short rem)
{
// Count number of polygons to remove.
int numRemovedVerts = 0;
int numTouchedVerts = 0;
int numRemainingEdges = 0;
for (int i = 0; i < mesh.npolys; ++i)
@@ -1419,7 +1427,6 @@ static bool canRemoveVertex(dtTileCachePolyMesh& mesh, const unsigned short rem)
}
if (numRemoved)
{
numRemovedVerts += numRemoved;
numRemainingEdges += numVerts-(numRemoved+1);
}
}
@@ -1551,7 +1558,7 @@ static dtStatus removeVertex(dtTileCachePolyMesh& mesh, const unsigned short rem
}
// Remove vertex.
for (int i = (int)rem; i < mesh.nverts; ++i)
for (int i = (int)rem; i < mesh.nverts - 1; ++i)
{
mesh.verts[i*3+0] = mesh.verts[(i+1)*3+0];
mesh.verts[i*3+1] = mesh.verts[(i+1)*3+1];