UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FNavMeshPath Struct Reference

#include <NavMeshPath.h>

+ Inheritance diagram for FNavMeshPath:

Public Types

typedef FNavigationPath Super
 

Public Member Functions

NAVIGATIONSYSTEM_API FNavMeshPath ()
 
NAVIGATIONSYSTEM_API ~FNavMeshPath ()
 
NAVIGATIONSYSTEM_API FNavMeshPath (const FNavMeshPath &)
 
NAVIGATIONSYSTEM_API FNavMeshPath (FNavMeshPath &&Other)
 
NAVIGATIONSYSTEM_API FNavMeshPathoperator= (const FNavMeshPath &Other)
 
NAVIGATIONSYSTEM_API FNavMeshPathoperator= (FNavMeshPath &&Other)
 
void SetWantsStringPulling (const bool bNewWantsStringPulling)
 
bool WantsStringPulling () const
 
bool IsStringPulled () const
 
NAVIGATIONSYSTEM_API void PerformStringPulling (const FVector &StartLoc, const FVector &EndLoc)
 
void SetWantsPathCorridor (const bool bNewWantsPathCorridor)
 
bool WantsPathCorridor () const
 
const TArray< FNavigationPortalEdge > & GetPathCorridorEdges () const
 
void SetPathCorridorEdges (const TArray< FNavigationPortalEdge > &InPathCorridorEdges)
 
void OnPathCorridorUpdated ()
 
virtual NAVIGATIONSYSTEM_API void DebugDraw (const ANavigationData *NavData, const FColor PathColor, UCanvas *Canvas, const bool bPersistent, const float LifeTime, const uint32 NextPathPointIndex=0) const override
 
NAVIGATIONSYSTEM_API bool ContainsWithSameEnd (const FNavMeshPath *Other) const
 
NAVIGATIONSYSTEM_API void OffsetFromCorners (FVector::FReal Distance)
 
NAVIGATIONSYSTEM_API void ApplyFlags (int32 NavDataFlags)
 
virtual NAVIGATIONSYSTEM_API void ResetForRepath () override
 
NAVIGATIONSYSTEM_API bool GetNodeFlags (int32 NodeIdx, FNavMeshNodeFlags &Flags) const
 
virtual FVector::FReal GetCostFromNode (NavNodeRef PathNode) const override
 
virtual FVector::FReal GetCostFromIndex (int32 PathPointIndex) const override
 
FVector::FReal GetTotalPathLength () const
 
int32 GetNodeRefIndex (const NavNodeRef NodeRef) const
 
virtual bool ContainsNode (NavNodeRef NodeRef) const override
 
virtual bool ContainsCustomLink (FNavLinkId UniqueLinkId) const override
 
virtual bool ContainsAnyCustomLink () const override
 
NAVIGATIONSYSTEM_API bool IsPathSegmentANavLink (const int32 PathSegmentStartIndex) const
 
virtual NAVIGATIONSYSTEM_API bool DoesIntersectBox (const FBox &Box, uint32 StartingIndex=0, int32 *IntersectingSegmentIndex=NULL, FVector *AgentExtent=NULL) const override
 
virtual NAVIGATIONSYSTEM_API bool DoesIntersectBox (const FBox &Box, const FVector &AgentLocation, uint32 StartingIndex=0, int32 *IntersectingSegmentIndex=NULL, FVector *AgentExtent=NULL) const override
 
virtual NAVIGATIONSYSTEM_API FVector GetSegmentDirection (uint32 SegmentEndIndex) const override
 
NAVIGATIONSYSTEM_API void Invert ()
 
- Public Member Functions inherited from FNavigationPath
 DECLARE_MULTICAST_DELEGATE_TwoParams (FPathObserverDelegate, FNavigationPath *, ENavPathEvent::Type)
 
NAVIGATIONSYSTEM_API FNavigationPath ()
 
NAVIGATIONSYSTEM_API FNavigationPath (const TArray< FVector > &Points, AActor *Base=NULL)
 
virtual NAVIGATIONSYSTEM_API ~FNavigationPath ()
 
PRAGMA_DISABLE_DEPRECATION_WARNINGS FNavigationPath (const FNavigationPath &)=default
 
FNavigationPathoperator= (const FNavigationPath &Other)=default
 
PRAGMA_ENABLE_DEPRECATION_WARNINGS bool IsValid () const
 
bool IsUpToDate () const
 
bool IsReady () const
 
bool IsPartial () const
 
bool DidSearchReachedLimit () const
 
bool IsErrorStartLocationNonNavigable () const
 
bool IsErrorEndLocationNonNavigable () const
 
bool IsWaitingForRepath () const
 
void SetManualRepathWaiting (const bool bInWaitingForRepath)
 
bool ShouldUpdateStartPointOnRepath () const
 
bool ShouldUpdateEndPointOnRepath () const
 
FVector GetDestinationLocation () const
 
FPathObserverDelegateGetObserver ()
 
FDelegateHandle AddObserver (FPathObserverDelegate::FDelegate NewObserver)
 
void RemoveObserver (FDelegateHandle HandleOfObserverToRemove)
 
void MarkReady ()
 
void SetNavigationDataUsed (const ANavigationData *const NewData)
 
ANavigationDataGetNavigationDataUsed () const
 
void SetQuerier (const UObject *InQuerier)
 
const UObjectGetQuerier () const
 
void SetQueryData (const FPathFindingQueryData &QueryData)
 
FPathFindingQueryData GetQueryData () const
 
void SetIsPartial (const bool bPartial)
 
void SetSearchReachedLimit (const bool bLimited)
 
void SetErrorStartLocationNonNavigable (const bool bErrorNonNavigable)
 
void SetErrorEndLocationNonNavigable (const bool bErrorNonNavigable)
 
void SetFilter (FSharedConstNavQueryFilter InFilter)
 
FSharedConstNavQueryFilter GetFilter () const
 
AActorGetBaseActor () const
 
FVector GetStartLocation () const
 
FVector GetEndLocation () const
 
void DoneUpdating (ENavPathUpdateType::Type UpdateType)
 
double GetTimeStamp () const
 
void SetTimeStamp (double TimeStamp)
 
NAVIGATIONSYSTEM_API void Invalidate ()
 
NAVIGATIONSYSTEM_API void RePathFailed ()
 
NAVIGATIONSYSTEM_API void RemoveOverlappingPoints (const FVector &Tolerance)
 
virtual bool ContainsCustomLink (uint32 UniqueLinkId) const final
 
FVector::FReal GetCost () const
 
virtual NAVIGATIONSYSTEM_API FVector::FReal GetLengthFromPosition (FVector SegmentStart, uint32 NextPathPointIndex) const
 
FVector::FReal GetLength () const
 
const TArray< FNavPathPoint > & GetPathPoints () const
 
TArray< FNavPathPoint > & GetPathPoints ()
 
NAVIGATIONSYSTEM_API FBasedPosition GetPathPointLocation (uint32 Index) const
 
template<typename PathClass >
const PathClassCastPath () const
 
template<typename PathClass >
PathClassCastPath ()
 
NAVIGATIONSYSTEM_API void SetGoalActorObservation (const AActor &ActorToObserve, float TetherDistance)
 
void SetGoalActorTetherDistance (const float NewTetherDistace)
 
NAVIGATIONSYSTEM_API void DisableGoalActorObservation ()
 
NAVIGATIONSYSTEM_API void SetSourceActor (const AActor &InSourceActor)
 
const AActorGetSourceActor () const
 
const INavAgentInterfaceGetSourceActorAsNavAgent () const
 
FVector GetLastRepathGoalLocation () const
 
NAVIGATIONSYSTEM_API void UpdateLastRepathGoalLocation ()
 
double GetLastUpdateTime () const
 
float GetGoalActorTetherDistance () const
 
void EnableRecalculationOnInvalidation (bool bShouldAutoUpdate)
 
bool WillRecalculateOnInvalidation () const
 
void SetIgnoreInvalidation (bool bShouldIgnore)
 
bool GetIgnoreInvalidation () const
 
NAVIGATIONSYSTEM_API EPathObservationResult::Type TickPathObservation ()
 
NAVIGATIONSYSTEM_API FVector GetGoalLocation () const
 
NAVIGATIONSYSTEM_API FVector GetPathFindingStartLocation () const
 
const AActorGetGoalActor () const
 
const INavAgentInterfaceGetGoalActorAsNavAgent () const
 
- Public Member Functions inherited from TSharedFromThis< FNavigationPath, ESPMode::ThreadSafe >
TSharedRef< FNavigationPath, Mode > AsShared ()
 
TSharedRef< FNavigationPath const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FNavigationPath, Mode > AsWeak ()
 
TWeakPtr< FNavigationPath const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Public Attributes

TArray< NavNodeRefPathCorridor
 
TArray< FVector::FRealPathCorridorCost
 
TArray< uint32CustomLinkIds
 
TArray< FNavLinkIdCustomNavLinkIds
 
uint32 bDynamic: 1
 
- Public Attributes inherited from FNavigationPath
TArray< NavNodeRefShortcutNodeRefs
 

Static Public Attributes

static NAVIGATIONSYSTEM_API const FNavPathType Type
 

Protected Member Functions

NAVIGATIONSYSTEM_API FVector::FReal GetStringPulledLength (const int32 StartingPoint) const
 
NAVIGATIONSYSTEM_API FVector::FReal GetPathCorridorLength (const int32 StartingEdge) const
 
NAVIGATIONSYSTEM_API const TArray< FNavigationPortalEdge > & GeneratePathCorridorEdges () const
 
- Protected Member Functions inherited from FNavigationPath
virtual void OnPathUpdated (ENavPathUpdateType::Type UpdateType)
 
- Protected Member Functions inherited from TSharedFromThis< FNavigationPath, ESPMode::ThreadSafe >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Protected Attributes

uint32 bStringPulled: 1
 
uint32 bWantsStringPulling: 1
 
uint32 bWantsPathCorridor: 1
 
- Protected Attributes inherited from FNavigationPath
TArray< FNavPathPointPathPoints
 
TWeakObjectPtr< AActorBase
 
FSharedConstNavQueryFilter Filter
 
FNavPathType PathType
 
FPathObserverDelegate ObserverDelegate
 
uint32 bUpToDate: 1
 
uint32 bIsReady: 1
 
uint32 bIsPartial: 1
 
uint32 bReachedSearchLimit: 1
 
uint32 bErrorStartLocationNonNavigable: 1 = false
 
uint32 bErrorEndLocationNonNavigable: 1 = false
 
uint32 bDoAutoUpdateOnInvalidation: 1
 
uint32 bIgnoreInvalidation: 1
 
uint32 bUpdateStartPointOnRepath: 1
 
uint32 bUpdateEndPointOnRepath: 1
 
uint32 bWaitingForRepath: 1
 
uint32 bUseOnPathUpdatedNotify: 1
 
uint32 bObservingGoalActor: 1
 
TWeakObjectPtr< ANavigationDataNavigationDataUsed
 
FPathFindingQueryData PathFindingQueryData
 
double LastUpdateTimeStamp
 

Additional Inherited Members

- Static Public Member Functions inherited from FNavigationPath
static bool GetPathPoint (const FNavigationPath *Path, uint32 PathVertIdx, FNavPathPoint &PathPoint)
 
- Static Protected Member Functions inherited from TSharedFromThis< FNavigationPath, ESPMode::ThreadSafe >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 
- Static Protected Attributes inherited from FNavigationPath
static NAVIGATIONSYSTEM_API const FNavPathType Type
 

Member Typedef Documentation

◆ Super

Constructor & Destructor Documentation

◆ FNavMeshPath() [1/3]

FNavMeshPath::FNavMeshPath ( )

◆ ~FNavMeshPath()

PRAGMA_DISABLE_DEPRECATION_WARNINGS FNavMeshPath::~FNavMeshPath ( )
default

◆ FNavMeshPath() [2/3]

FNavMeshPath::FNavMeshPath ( const FNavMeshPath )
default

◆ FNavMeshPath() [3/3]

FNavMeshPath::FNavMeshPath ( FNavMeshPath &&  Other)
default

Member Function Documentation

◆ ApplyFlags()

void FNavMeshPath::ApplyFlags ( int32  NavDataFlags)

◆ ContainsAnyCustomLink()

virtual bool FNavMeshPath::ContainsAnyCustomLink ( ) const
inlineoverridevirtual

check if path contains any custom nav link

Reimplemented from FNavigationPath.

◆ ContainsCustomLink()

virtual bool FNavMeshPath::ContainsCustomLink ( FNavLinkId  UniqueLinkId) const
inlineoverridevirtual

Reimplemented from FNavigationPath.

◆ ContainsNode()

virtual bool FNavMeshPath::ContainsNode ( NavNodeRef  NodeRef) const
inlineoverridevirtual

check if path (all polys in corridor) contains given node

Reimplemented from FNavigationPath.

◆ ContainsWithSameEnd()

bool FNavMeshPath::ContainsWithSameEnd ( const FNavMeshPath Other) const

◆ DebugDraw()

void FNavMeshPath::DebugDraw ( const ANavigationData NavData,
const FColor  PathColor,
UCanvas Canvas,
const bool  bPersistent,
const float  LifeTime,
const uint32  NextPathPointIndex = 0 
) const
overridevirtual

Reimplemented from FNavigationPath.

Reimplemented in FMetaNavMeshPath.

◆ DoesIntersectBox() [1/2]

bool FNavMeshPath::DoesIntersectBox ( const FBox Box,
const FVector AgentLocation,
uint32  StartingIndex = 0,
int32 IntersectingSegmentIndex = NULL,
FVector AgentExtent = NULL 
) const
overridevirtual

checks if given path, starting from StartingIndex, intersects with given AABB box. This version uses AgentLocation as beginning of the path with segment between AgentLocation and path's StartingIndex-th node treated as first path segment to check

Reimplemented from FNavigationPath.

◆ DoesIntersectBox() [2/2]

bool FNavMeshPath::DoesIntersectBox ( const FBox Box,
uint32  StartingIndex = 0,
int32 IntersectingSegmentIndex = NULL,
FVector AgentExtent = NULL 
) const
overridevirtual

checks if given path, starting from StartingIndex, intersects with given AABB box

Reimplemented from FNavigationPath.

◆ GeneratePathCorridorEdges()

const TArray< FNavigationPortalEdge > & FNavMeshPath::GeneratePathCorridorEdges ( ) const
protected

it's only const to be callable in const environment. It's not supposed to be called directly externally anyway, just as part of retrieving corridor on demand or generating it in internal processes. It fills a mutable array.

◆ GetCostFromIndex()

virtual FVector::FReal FNavMeshPath::GetCostFromIndex ( int32  PathPointIndex) const
inlineoverridevirtual

get cost of path, starting from given point

Reimplemented from FNavigationPath.

Reimplemented in FMetaNavMeshPath.

◆ GetCostFromNode()

virtual FVector::FReal FNavMeshPath::GetCostFromNode ( NavNodeRef  PathNode) const
inlineoverridevirtual

get cost of path, starting from next poly in corridor

Reimplemented from FNavigationPath.

◆ GetNodeFlags()

bool FNavMeshPath::GetNodeFlags ( int32  NodeIdx,
FNavMeshNodeFlags Flags 
) const

get flags of path point or corridor poly (depends on bStringPulled flag)

◆ GetNodeRefIndex()

int32 FNavMeshPath::GetNodeRefIndex ( const NavNodeRef  NodeRef) const
inline

◆ GetPathCorridorEdges()

const TArray< FNavigationPortalEdge > & FNavMeshPath::GetPathCorridorEdges ( ) const
inline

◆ GetPathCorridorLength()

FVector::FReal FNavMeshPath::GetPathCorridorLength ( const int32  StartingEdge) const
protected

calculates estimated length of path expressed as sequence of navmesh edges. It basically sums up distances between every subsequent nav edge pair edge middles. Internal use only

◆ GetSegmentDirection()

FVector FNavMeshPath::GetSegmentDirection ( uint32  SegmentEndIndex) const
overridevirtual

retrieves normalized direction vector to given path segment. If path is not string pulled navigation corridor is being used

Reimplemented from FNavigationPath.

◆ GetStringPulledLength()

FVector::FReal FNavMeshPath::GetStringPulledLength ( const int32  StartingPoint) const
protected

calculates total length of string pulled path. Does not generate string pulled path if it's not already generated (see bWantsStringPulling and bStrigPulled) Internal use only

◆ GetTotalPathLength()

FVector::FReal FNavMeshPath::GetTotalPathLength ( ) const
inline

◆ Invert()

void FNavMeshPath::Invert ( )

◆ IsPathSegmentANavLink()

bool FNavMeshPath::IsPathSegmentANavLink ( const int32  PathSegmentStartIndex) const

◆ IsStringPulled()

bool FNavMeshPath::IsStringPulled ( ) const
inline

◆ OffsetFromCorners()

void FNavMeshPath::OffsetFromCorners ( FVector::FReal  Distance)

add new point only if we don't see our next location otherwise use last visible point

◆ OnPathCorridorUpdated()

void FNavMeshPath::OnPathCorridorUpdated ( )
inline

◆ operator=() [1/2]

FNavMeshPath & FNavMeshPath::operator= ( const FNavMeshPath Other)
default

◆ operator=() [2/2]

FNavMeshPath & FNavMeshPath::operator= ( FNavMeshPath &&  Other)
default

◆ PerformStringPulling()

void FNavMeshPath::PerformStringPulling ( const FVector StartLoc,
const FVector EndLoc 
)

find string pulled path from PathCorridor

◆ ResetForRepath()

PRAGMA_ENABLE_DEPRECATION_WARNINGS void FNavMeshPath::ResetForRepath ( )
overridevirtual

Resets all variables describing generated path before attempting new pathfinding call. This function will NOT reset setup variables like goal actor, filter, observer, etc

Reimplemented from FNavigationPath.

◆ SetPathCorridorEdges()

void FNavMeshPath::SetPathCorridorEdges ( const TArray< FNavigationPortalEdge > &  InPathCorridorEdges)
inline

◆ SetWantsPathCorridor()

void FNavMeshPath::SetWantsPathCorridor ( const bool  bNewWantsPathCorridor)
inline

◆ SetWantsStringPulling()

void FNavMeshPath::SetWantsStringPulling ( const bool  bNewWantsStringPulling)
inline

◆ WantsPathCorridor()

bool FNavMeshPath::WantsPathCorridor ( ) const
inline

◆ WantsStringPulling()

bool FNavMeshPath::WantsStringPulling ( ) const
inline

Member Data Documentation

◆ bDynamic

uint32 FNavMeshPath::bDynamic

is this path generated on dynamic navmesh (i.e. one attached to moving surface)

◆ bStringPulled

uint32 FNavMeshPath::bStringPulled
protected

does this path contain string pulled path? If true then NumPathVerts > 0 and OutPathVerts contains valid data. If false there's only navigation corridor data available.

◆ bWantsPathCorridor

uint32 FNavMeshPath::bWantsPathCorridor
protected

If set to true path instance will contain path corridor generated as a part pathfinding call (i.e. without the need to generate it with GeneratePathCorridorEdges

◆ bWantsStringPulling

uint32 FNavMeshPath::bWantsStringPulling
protected

If set to true path instance will contain a string pulled version. Otherwise only navigation corridor will be available. Defaults to true

◆ CustomLinkIds

TArray<uint32> FNavMeshPath::CustomLinkIds

set of unique link Ids

◆ CustomNavLinkIds

TArray<FNavLinkId> FNavMeshPath::CustomNavLinkIds

◆ PathCorridor

TArray<NavNodeRef> FNavMeshPath::PathCorridor

sequence of navigation mesh poly ids representing an obstacle-free navigation corridor

◆ PathCorridorCost

TArray<FVector::FReal> FNavMeshPath::PathCorridorCost

for every poly in PathCorridor stores traversal cost from previous navpoly

◆ Type

const FNavPathType FNavMeshPath::Type
static

The documentation for this struct was generated from the following files: