Recast: make polygon draw softening optional

This commit is contained in:
Kawe Mazidjatari 2024-07-18 00:58:20 +02:00
parent c22675af86
commit 93439d9055
2 changed files with 6 additions and 6 deletions

View File

@ -46,9 +46,9 @@ void duDebugDrawNavMeshNodes(struct duDebugDraw* dd, const dtNavMeshQuery& query
void duDebugDrawNavMeshBVTree(struct duDebugDraw* dd, const dtNavMesh& mesh, const float* offset);
void duDebugDrawNavMeshPortals(struct duDebugDraw* dd, const dtNavMesh& mesh, const float* offset);
void duDebugDrawNavMeshPolysWithFlags(struct duDebugDraw* dd, const dtNavMesh& mesh, const unsigned short polyFlags, const float* offset,
const unsigned int drawFlags, const unsigned int col);
const unsigned int drawFlags, const unsigned int col, const bool soften = true);
void duDebugDrawNavMeshPoly(struct duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const float* offset,
const unsigned int drawFlags, const unsigned int col);
const unsigned int drawFlags, const unsigned int col, const bool soften = true);
void duDebugDrawTileCacheLayerAreas(struct duDebugDraw* dd, const dtTileCacheLayer& layer, const float cs, const float ch, const float* offset);
void duDebugDrawTileCacheLayerRegions(struct duDebugDraw* dd, const dtTileCacheLayer& layer, const float cs, const float ch, const float* offset);

View File

@ -461,7 +461,7 @@ void duDebugDrawNavMeshPortals(duDebugDraw* dd, const dtNavMesh& mesh, const flo
}
void duDebugDrawNavMeshPolysWithFlags(struct duDebugDraw* dd, const dtNavMesh& mesh, const unsigned short polyFlags,
const float* offset, const unsigned int drawFlags, const unsigned int col)
const float* offset, const unsigned int drawFlags, const unsigned int col, const bool soften)
{
if (!dd) return;
@ -475,12 +475,12 @@ void duDebugDrawNavMeshPolysWithFlags(struct duDebugDraw* dd, const dtNavMesh& m
{
const dtPoly* p = &tile->polys[j];
if ((p->flags & polyFlags) == 0) continue;
duDebugDrawNavMeshPoly(dd, mesh, base|(dtPolyRef)j, offset, col, drawFlags);
duDebugDrawNavMeshPoly(dd, mesh, base|(dtPolyRef)j, offset, col, drawFlags, soften);
}
}
}
void duDebugDrawNavMeshPoly(duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const float* offset, const unsigned int drawFlags, const unsigned int col)
void duDebugDrawNavMeshPoly(duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const float* offset, const unsigned int drawFlags, const unsigned int col, const bool soften)
{
if (!dd) return;
@ -492,7 +492,7 @@ void duDebugDrawNavMeshPoly(duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef re
const bool depthTest = drawFlags & DU_DRAWNAVMESH_DEPTH_MASK;
dd->depthMask(depthTest);
const unsigned int c = duTransCol(col, 64);
const unsigned int c = soften ? duTransCol(col, 64) : col;
const unsigned int ip = (unsigned int)(poly - tile->polys);
if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION)