Navigation
API > API/Runtime > API/Runtime/Navmesh > API/Runtime/Navmesh/dtNavMeshQuery
Warnings * This function is not suitable for large area searches. If the search extents overlaps more than 128 polygons it may return an invalid result.
Description
Finds the nearest polygon in height containing the specified center point.
If the search box does not intersect any polygons the search will return DT_SUCCESS, but nearestRef_ will be zero. So if in doubt, check nearestRef_ before using `nearestPt_.
This function is not suitable for large area searches. If the search extents overlaps more than 128 polygons it may return an invalid result.
| Name | findNearestContainingPoly |
| 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 findNearestContainingPoly
(
const dtReal * center,
const dtReal * extents,
const dtQueryFilter * filter,
dtPolyRef * nearestRef,
dtReal * nearestPt
) const
The status flags for the query.
Parameters
| Name | Remarks |
|---|---|
| center | The center of the search box. [(x, y, z)] |
| extents | The search distance along each axis. [(x, y, z)] |
| filter | The polygon filter to apply to the query. |
| nearestRef | The reference id of the nearest polygon. |
| nearestPt | The nearest point on the polygon. [opt] [(x, y, z)] |