mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: use spherical extends to clamp off-mesh link to poly
The traversability of off-mesh links is not dictated by the walkable climb in this engine; an off-mesh connection can be higher from the ground due to ziplines.
This commit is contained in:
parent
81c0cab610
commit
64de9f6a48
@ -555,7 +555,7 @@ dtPolyRef dtNavMesh::clampOffMeshVertToPoly(dtOffMeshConnection* con, dtMeshTile
|
||||
const dtMeshTile* lookupTile, const bool start)
|
||||
{
|
||||
const float* p = start ? &con->pos[0] : &con->pos[3];
|
||||
const float halfExtents[3] = { con->rad, con->rad, lookupTile->header->walkableClimb };
|
||||
const float halfExtents[3] = { con->rad, con->rad, con->rad };
|
||||
|
||||
float nearestPt[3];
|
||||
dtPolyRef ref = findNearestPolyInTile(lookupTile, p, halfExtents, nearestPt);
|
||||
@ -656,7 +656,7 @@ dtStatus dtNavMesh::connectOffMeshLinks(const dtTileRef tileRef)
|
||||
return DT_FAILURE | DT_OUT_OF_MEMORY;
|
||||
|
||||
// connect to land points.
|
||||
const float halfExtents[3] = { con->rad, con->rad, header->walkableClimb };
|
||||
const float halfExtents[3] = { con->rad, con->rad, con->rad };
|
||||
float bmin[3], bmax[3];
|
||||
rdVsub(bmin, &con->pos[3], halfExtents);
|
||||
rdVadd(bmax, &con->pos[3], halfExtents);
|
||||
|
Loading…
x
Reference in New Issue
Block a user