dtNavMeshQuery::moveAlongSurface

Moves from the start to the end position constrained to the navigation mesh.

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 moveAlongSurface
(
    dtPolyRef startRef,
    const float * startPos,
    const float * endPos,
    const dtQueryFilter * filter,
    float * resultPos,
    dtPolyRef * visited,
    int * visitedCount,
    const int maxVisitedSize
) const

Remarks

Moves from the start to the end position constrained to the navigation mesh.

This method is optimized for small delta movement and a small number of polygons. If used for too great a distance, the result set will form an incomplete path.

resultPos_ will equal the endPos_ if the end is reached. Otherwise the closest reachable position will be returned.

`resultPos_ is not projected onto the surface of the navigation mesh. Use getPolyHeight if this is needed.

This method treats the end position in the same manner as the raycast method. (As a 2D point.) See that method's documentation for details.

If the `visited_ array is too small to hold the entire result set, it will be filled as far as possible from the start position toward the end position.

Returns

The status flags for the query.

Parameters

Parameter

Description

startRef

The reference id of the start polygon.

startPos

A position of the mover within the start polygon. [(x, y, x)]

endPos

The desired end position of the mover. [(x, y, z)]

filter

The polygon filter to apply to the query.

resultPos

The result position of the mover. [(x, y, z)]

visited

The reference ids of the polygons visited during the move.

visitedCount

The number of polygons visited during the move.

maxVisitedSize

The maximum number of polygons the visited array 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