mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: add method for marking cells as occupied
This commit is contained in:
parent
3227208533
commit
66cf9678d2
@ -377,8 +377,8 @@ static void drawTileCells(duDebugDraw* dd, const dtMeshTile* tile, const float*
|
||||
#if DT_NAVMESH_SET_VERSION >= 8
|
||||
for (int i = 0; i < tile->header->maxCellCount; i++)
|
||||
{
|
||||
const dtCell& probe = tile->cells[i];
|
||||
duDebugDrawCross(dd, probe.pos[0], probe.pos[1], probe.pos[2], 25.f, duRGBA(255,0,0,255), 2, offset);
|
||||
const dtCell& cell = tile->cells[i];
|
||||
duDebugDrawCross(dd, cell.pos[0], cell.pos[1], cell.pos[2], 25.f, duRGBA(255,0,0,255), 2, offset);
|
||||
}
|
||||
#else
|
||||
rdIgnoreUnused(dd);
|
||||
|
@ -322,6 +322,8 @@ unsigned char dtQuantLinkDistance(const float distance);
|
||||
/// @see dtMeshTile
|
||||
struct dtCell
|
||||
{
|
||||
inline void setOccupied() { *(int*)((uintptr_t)&occupyState & ~0x3) = -1; }
|
||||
|
||||
float pos[3]; ///< The position of the cell.
|
||||
unsigned int polyIndex; ///< The index of the poly this cell is on.
|
||||
unsigned char pad;
|
||||
|
@ -1107,9 +1107,7 @@ bool dtCreateNavMeshData(dtNavMeshCreateParams* params, unsigned char** outData,
|
||||
|
||||
rdVcopy(cell.pos, cellItem.pos);
|
||||
cell.polyIndex = cellItem.polyIndex;
|
||||
|
||||
int* state = (int*)((uintptr_t)&cell.occupyState & ~0x3);
|
||||
*state = -1;
|
||||
cell.setOccupied();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user