UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NavMeshPath.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_4
6#include "CoreMinimal.h"
7#endif
9#include "UObject/Object.h"
10#include "NavigationPath.h"
11//#include "NavigationPath.generated.h"
12
13#define RECAST_STRAIGHTPATH_OFFMESH_CONNECTION 0x04
14
36
37
39{
41
44
49
51 inline bool WantsStringPulling() const { return bWantsStringPulling; }
52 inline bool IsStringPulled() const { return bStringPulled; }
53
55 NAVIGATIONSYSTEM_API void PerformStringPulling(const FVector& StartLoc, const FVector& EndLoc);
56
58 inline bool WantsPathCorridor() const { return bWantsPathCorridor; }
59
60 inline const TArray<FNavigationPortalEdge>& GetPathCorridorEdges() const { return bCorridorEdgesGenerated ? PathCorridorEdges : GeneratePathCorridorEdges(); }
61 inline void SetPathCorridorEdges(const TArray<FNavigationPortalEdge>& InPathCorridorEdges) { PathCorridorEdges = InPathCorridorEdges; bCorridorEdgesGenerated = true; }
62
63 inline void OnPathCorridorUpdated() { bCorridorEdgesGenerated = false; }
64
65 NAVIGATIONSYSTEM_API virtual void DebugDraw(const ANavigationData* NavData, const FColor PathColor, UCanvas* Canvas, const bool bPersistent, const float LifeTime, const uint32 NextPathPointIndex = 0) const override;
66
68
70
71 NAVIGATIONSYSTEM_API void ApplyFlags(int32 NavDataFlags);
72
73 NAVIGATIONSYSTEM_API virtual void ResetForRepath() override;
74
77
80
83 {
84 FVector::FReal TotalCost = 0.f;
87 {
88 TotalCost += *Cost;
89 }
90
91 return TotalCost;
92 }
93
98
99 inline int32 GetNodeRefIndex(const NavNodeRef NodeRef) const { return PathCorridor.Find(NodeRef); }
100
102 virtual bool ContainsNode(NavNodeRef NodeRef) const override { return PathCorridor.Contains(NodeRef); }
103
105 virtual bool ContainsAnyCustomLink() const override { return CustomNavLinkIds.Num() > 0; }
106
107 NAVIGATIONSYSTEM_API bool IsPathSegmentANavLink(const int32 PathSegmentStartIndex) const;
108
113
115
116private:
117 NAVIGATIONSYSTEM_API bool DoesPathIntersectBoxImplementation(const FBox& Box, const FVector& StartLocation, uint32 StartingIndex, int32* IntersectingSegmentIndex, FVector* AgentExtent) const;
118 NAVIGATIONSYSTEM_API void InternalResetNavMeshPath();
119
120public:
121
122#if ENABLE_VISUAL_LOG
123 NAVIGATIONSYSTEM_API virtual void DescribeSelfToVisLog(struct FVisualLogEntry* Snapshot) const override;
124 NAVIGATIONSYSTEM_API virtual FString GetDescription() const override;
125#endif // ENABLE_VISUAL_LOG
126
127protected:
132
137
142
143public:
144
147
150
152 UE_DEPRECATED(5.3, "LinkIds are now based on FNavLinkId. Use CustomNavLinkIds instead. CustomLinkIds array is no longer populated or used in the engine")
154
156
157private:
161 mutable TArray<FNavigationPortalEdge> PathCorridorEdges;
162
164 mutable uint32 bCorridorEdgesGenerated : 1;
165
166public:
169
175
179
183
184public:
186};
#define NULL
Definition oodle2base.h:134
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define RECAST_STRAIGHTPATH_OFFMESH_CONNECTION
Definition NavMeshPath.h:13
uint64 NavNodeRef
Definition NavigationTypes.h:34
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NavigationData.h:547
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
bool Contains(const ComparisonType &Item) const
Definition Array.h:1518
UE_NODEBUG UE_FORCEINLINE_HINT bool Find(const ElementType &Item, SizeType &Index) const
Definition Array.h:1302
Definition Canvas.h:159
Definition Color.h:486
Definition NavigationTypes.h:150
Definition NavMeshPath.h:17
bool IsNavLink() const
Definition NavMeshPath.h:28
FNavMeshNodeFlags & AddAreaFlags(const uint16 InAreaFlags)
Definition NavMeshPath.h:30
uint8 Area
Definition NavMeshPath.h:21
uint8 PathFlags
Definition NavMeshPath.h:19
uint16 AreaFlags
Definition NavMeshPath.h:23
FNavMeshNodeFlags()
Definition NavMeshPath.h:25
FNavMeshNodeFlags(const uint32 Flags)
Definition NavMeshPath.h:26
uint32 Pack() const
Definition NavMeshPath.h:27
Definition NavMeshPath.h:39
bool IsStringPulled() const
Definition NavMeshPath.h:52
uint32 bDynamic
Definition NavMeshPath.h:168
TArray< NavNodeRef > PathCorridor
Definition NavMeshPath.h:146
NAVIGATIONSYSTEM_API void Invert()
Definition NavMeshPath.cpp:789
void OnPathCorridorUpdated()
Definition NavMeshPath.h:63
TArray< FNavLinkId > CustomNavLinkIds
Definition NavMeshPath.h:155
NAVIGATIONSYSTEM_API FNavMeshPath & operator=(const FNavMeshPath &Other)
virtual FVector::FReal GetCostFromIndex(int32 PathPointIndex) const override
Definition NavMeshPath.h:82
NAVIGATIONSYSTEM_API const TArray< FNavigationPortalEdge > & GeneratePathCorridorEdges() const
Definition NavMeshPath.cpp:111
NAVIGATIONSYSTEM_API FNavMeshPath(FNavMeshPath &&Other)
NAVIGATIONSYSTEM_API void OffsetFromCorners(FVector::FReal Distance)
Definition NavMeshPath.cpp:290
NAVIGATIONSYSTEM_API void ApplyFlags(int32 NavDataFlags)
Definition NavMeshPath.cpp:269
bool WantsPathCorridor() const
Definition NavMeshPath.h:58
int32 GetNodeRefIndex(const NavNodeRef NodeRef) const
Definition NavMeshPath.h:99
uint32 bWantsStringPulling
Definition NavMeshPath.h:178
NAVIGATIONSYSTEM_API ~FNavMeshPath()
FNavigationPath Super
Definition NavMeshPath.h:40
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
Definition NavMeshPath.cpp:524
NAVIGATIONSYSTEM_API FVector::FReal GetStringPulledLength(const int32 StartingPoint) const
Definition NavMeshPath.cpp:64
bool WantsStringPulling() const
Definition NavMeshPath.h:51
TArray< uint32 > CustomLinkIds
Definition NavMeshPath.h:153
virtual bool ContainsCustomLink(FNavLinkId UniqueLinkId) const override
Definition NavMeshPath.h:104
virtual NAVIGATIONSYSTEM_API FVector GetSegmentDirection(uint32 SegmentEndIndex) const override
Definition NavMeshPath.cpp:756
TArray< FVector::FReal > PathCorridorCost
Definition NavMeshPath.h:149
NAVIGATIONSYSTEM_API void PerformStringPulling(const FVector &StartLoc, const FVector &EndLoc)
Definition NavMeshPath.cpp:130
virtual bool ContainsNode(NavNodeRef NodeRef) const override
Definition NavMeshPath.h:102
NAVIGATIONSYSTEM_API FVector::FReal GetPathCorridorLength(const int32 StartingEdge) const
Definition NavMeshPath.cpp:83
uint32 bStringPulled
Definition NavMeshPath.h:174
NAVIGATIONSYSTEM_API FNavMeshPath()
Definition NavMeshPath.cpp:26
void SetPathCorridorEdges(const TArray< FNavigationPortalEdge > &InPathCorridorEdges)
Definition NavMeshPath.h:61
NAVIGATIONSYSTEM_API FNavMeshPath & operator=(FNavMeshPath &&Other)
NAVIGATIONSYSTEM_API bool IsPathSegmentANavLink(const int32 PathSegmentStartIndex) const
Definition NavMeshPath.cpp:518
NAVIGATIONSYSTEM_API FNavMeshPath(const FNavMeshPath &)
NAVIGATIONSYSTEM_API bool ContainsWithSameEnd(const FNavMeshPath *Other) const
Definition NavMeshPath.cpp:561
virtual NAVIGATIONSYSTEM_API void ResetForRepath() override
Definition NavMeshPath.cpp:42
virtual FVector::FReal GetCostFromNode(NavNodeRef PathNode) const override
Definition NavMeshPath.h:79
NAVIGATIONSYSTEM_API bool GetNodeFlags(int32 NodeIdx, FNavMeshNodeFlags &Flags) const
Definition NavMeshPath.cpp:726
static NAVIGATIONSYSTEM_API const FNavPathType Type
Definition NavMeshPath.h:185
void SetWantsStringPulling(const bool bNewWantsStringPulling)
Definition NavMeshPath.h:50
void SetWantsPathCorridor(const bool bNewWantsPathCorridor)
Definition NavMeshPath.h:57
FVector::FReal GetTotalPathLength() const
Definition NavMeshPath.h:94
virtual bool ContainsAnyCustomLink() const override
Definition NavMeshPath.h:105
const TArray< FNavigationPortalEdge > & GetPathCorridorEdges() const
Definition NavMeshPath.h:60
uint32 bWantsPathCorridor
Definition NavMeshPath.h:182
virtual NAVIGATIONSYSTEM_API bool DoesIntersectBox(const FBox &Box, uint32 StartingIndex=0, int32 *IntersectingSegmentIndex=NULL, FVector *AgentExtent=NULL) const override
Definition NavMeshPath.cpp:691
Definition NavigationTypes.h:316
Definition NavigationData.h:87
Definition NavigationTypes.h:227
Definition VisualLoggerTypes.h:205
double FReal
Definition Vector.h:55