dtNavMeshQuery::findRandomPointAroundCircle

Returns random location on navmesh within the reach of specified location.

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 findRandomPointAroundCircle
(
    dtPolyRef startRef,
    const float * centerPos,
    const float maxRadius,
    const dtQueryFilter * filter,
    float(*)() frand,
    dtPolyRef * randomRef,
    float * randomPt
) const

Remarks

Returns random location on navmesh within the reach of specified location. Polygons are chosen weighted by area. The search runs in linear related to number of polygon. The location is not exactly constrained by the circle, but it limits the visited polygons.

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)]

filter

The polygon filter to apply to the query.

frand

Function returning a random number [0..1).

randomRef

The reference id of the random location.

randomPt

The random location. [(x, y, z)]

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