dtNavMeshQuery::findPolysAroundCircle

Finds the polygons along the navigation graph that touch the specified circle.

Windows
MacOS
Linux

References

Module

Navmesh

Header

/Engine/Source/Runtime/Navmesh/Public/Detour/DetourNavMeshQuery.h

Include

#include "Detour/DetourNavMeshQuery.h"

Source

/Engine/Source/Runtime/Navmesh/Private/Detour/DetourNavMeshQuery.cpp

Syntax

dtStatus findPolysAroundCircle
(
    dtPolyRef startRef,
    const float * centerPos,
    const float radius,
    const dtQueryFilter * filter,
    dtPolyRef * resultRef,
    dtPolyRef * resultParent,
    float * resultCost,
    int * resultCount,
    const int maxResult
) const

Remarks

Finds the polygons along the navigation graph that touch the specified circle.

At least one result array must be provided.

The order of the result set is from least to highest cost to reach the polygon.

A common use case for this method is to perform Dijkstra searches. Candidate polygons are found by searching the graph beginning at the start polygon.

If a polygon is not found via the graph search, even if it intersects the search circle, it will not be included in the result set. For example:

polyA is the start polygon. polyB shares an edge with polyA. (Is adjacent.) polyC shares an edge with polyB, but not with polyA Even if the search circle overlaps polyC, it will not be included in the result set unless polyB is also in the set.

The value of the center point is used as the start position for cost calculations. It is not projected onto the surface of the mesh, so its y-value will effect the costs.

Intersection tests occur in 2D. All polygons and the search circle are projected onto the xz-plane. So the y-value of the center point does not effect intersection tests.

If the result arrays are to small to hold the entire result set, they will be filled to capacity.

Returns

The status flags for the query.

Parameters

Parameter

Description

startRef

The reference id of the polygon where the search starts.

centerPos

The center of the search circle. [(x, y, z)]

radius

The radius of the search circle.

filter

The polygon filter to apply to the query.

resultRef

The reference ids of the polygons touched by the circle. [opt]

resultParent

The reference ids of the parent polygons for each result. Zero if a result polygon has no parent. [opt]

resultCost

The search cost from centerPos to the polygon. [opt]

resultCount

The number of polygons found. [opt]

maxResult

The maximum number of polygons the result arrays can hold.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss