dtNavMeshQuery::findStraightPath

Finds the straight path from the start to the end position within the polygon corridor.

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 findStraightPath
(
    const float * startPos,
    const float * endPos,
    const dtPolyRef * path,
    const int pathSize,
    dtQueryResult & result,
    const int options
) const

Remarks

Finds the straight path from the start to the end position within the polygon corridor.

This method peforms what is often called 'string pulling'.

The start position is clamped to the first polygon in the path, and the end position is clamped to the last. So the start and end positions should normally be within or very near the first and last polygons respectively.

The returned polygon references represent the reference id of the polygon that is entered at the associated path position. The reference id associated with the end point will always be zero. This allows, for example, matching off-mesh link points to their representative polygons.

If the provided result buffers are too small for the entire result set, they will be filled as far as possible from the start toward the end position.

Returns

The status flags for the query.

Parameters

Parameter

Description

startPos

Path start position. [(x, y, z)]

endPos

Path end position. [(x, y, z)]

path

An array of polygon references that represent the path corridor.

pathSize

The number of polygons in the path array.

result

Fills in positions, refs and flags

options

Query options. (see: dtStraightPathOptions)

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