Navigation
API > API/Runtime > API/Runtime/Navmesh > API/Runtime/Navmesh/dtNavMeshQuery
Description
Finds the distance from the specified position to the nearest polygon wall.
`hitPos_ is not adjusted using the height detail data.
hitDist_ will equal the search radius if there is no wall within the radius. In this case the values of hitPos_ and `hitNormal_ are undefined.
The normal will become unpredicable if `hitDist_ is a very small number.
| Name | findDistanceToWall |
| Type | function |
| Header File | /Engine/Source/Runtime/Navmesh/Public/Detour/DetourNavMeshQuery.h |
| Include Path | #include "Detour/DetourNavMeshQuery.h" |
| Source | /Engine/Source/Runtime/Navmesh/Private/Detour/DetourNavMeshQuery.cpp |
dtStatus findDistanceToWall
(
dtPolyRef startRef,
const dtReal * centerPos,
const dtReal maxRadius,
const dtQueryFilter * filter,
dtReal * hitDist,
dtReal * hitPos,
dtReal * hitNormal
) const
The status flags for the query.
Parameters
| Name | Remarks |
|---|---|
| startRef | The reference id of the polygon containing centerPos. |
| centerPos | The center of the search circle. [(x, y, z)] |
| maxRadius | The radius of the search circle. |
| filter | The polygon filter to apply to the query. |
| hitDist | The distance to the nearest wall from centerPos. |
| hitPos | The nearest position on the wall that was hit. [(x, y, z)] |
| hitNormal | The normalized ray formed from the wall point to the source point. [(x, y, z)] |