FMetaNavMeshPath

[FMetaNavMeshPath](API\Runtime\AIModule\Navigation\FMetaNavMeshPath) allows creating hierarchical or guided navmesh paths

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

AIModule

Header

/Engine/Source/Runtime/AIModule/Classes/Navigation/MetaNavMeshPath.h

Include

#include "Navigation/MetaNavMeshPath.h"

Syntax

struct FMetaNavMeshPath : public FNavMeshPath

Remarks

FMetaNavMeshPath allows creating hierarchical or guided navmesh paths

Waypoints array defines list of locations that will be used to create actual FNavMeshPath data during path following. On path following start and upon reaching waypoint, path will request update from owning navmesh with following parameters:

  • start location set to agent location

  • end location set to target waypoint (or goal actor for last one)

  • goal actor set only for last section

Since path updates itself for moving agent it really shouldn't be reused by others.

Variables

Name Description

Protected variable

float

 

ApproximateLength

Sum of 3D distance along waypoints, used for approximating length of path

Protected variable

TWeakObjectPtr<...

 

PathGoal

Stored goal actor

Protected variable

float

 

PathGoalTetherDistance

Stored goal actor's tether distance

Protected variable

int32

 

TargetWaypointIdx

Current target of path following

Protected variable

TArray< FMetaPa...

 

Waypoints

List of waypoints, including start and end of path

Protected variable

float

 

WaypointSwitchRadius

Update navmesh path when this close to target waypoint

Constructors

Name Description

Public function

FMetaNavMeshPath()

Public function

FMetaNavMeshPath

(
    const TArray< FMetaPathWayPoint >&...,
    const ANavigationData& NavData
)

Public function

FMetaNavMeshPath

(
    const TArray< FMetaPathWayPoint >&...,
    const AController& Owner
)

Public function

FMetaNavMeshPath

(
    const TArray< FVector >& InWaypoin...,
    const ANavigationData& NavData
)

Public function

FMetaNavMeshPath

(
    const TArray< FVector >& InWaypoin...,
    const AController& Owner
)

Functions

Name Description

Public function Virtual

bool

 

ConditionalMoveToNextSection

(
    const FVector& AgentLocation,
    EMetaPathUpdateReason Reason
)

Try switching to next waypoint, depends on WaypointSwitchRadius

Public function Virtual

void

 

CopyFrom

(
    const FMetaNavMeshPath& Other
)

Copy properties of other meta path

Public function

bool

 

ForceMoveToNextSection

(
    const FVector& AgentLocation
)

Force switching to next waypoint

Public function Const

AActor *

 

GetMetaPathGoal()

Returns cached path goal

Public function Const

int32

 

GetNumWaypoints()

Returns number of waypoints

Public function Const

int32

 

GetTargetWaypointIndex()

Returns index of current target waypoint

Public function Const

const TArray...

 

GetWaypointArray()

Returns waypoint array

Public function Const

float

 

GetWaypointSwitchRadius()

Returns radius for switching to next waypoint during path following

Public function Virtual

void

 

Initialize

(
    const FVector& AgentLocation
)

Initialize path for path following

Public function Const

bool

 

IsLastSection()

Returns true if path at last waypoint

Protected function

bool

 

MoveToNextSection

(
    const FVector& AgentLocation
)

Switch to next waypoint

Public function

bool

 

SetWaypoints

(
    const TArray< FMetaPathWayPoint >&...
)

Tries to set waypoints, fails when path is ready being followed

Public function

bool

 

SetWaypoints

(
    const TArray< FVector >& InWaypoin...
)

Tries to set waypoints, fails when path is ready being followed

Public function

void

 

SetWaypointSwitchRadius

(
    float InSwitchRadius
)

Sets radius for switching to next waypoint during path following

Public function Virtual

bool

 

UpdatePath

(
    const FVector& AgentLocation
)

Updates underlying navmesh path for current target waypoint

Overridden from FNavigationPath

Name Description

Public function Virtual Const

void

 

DebugDraw

(
    const ANavigationData* NavData,
    FColor PathColor,
    UCanvas* Canvas,
    bool bPersistent,
    const uint32 NextPathPointIndex
)

Public function Virtual Const

void

 

DescribeSelfToVisLog

(
    FVisualLogEntry* Snapshot
)

Public function Virtual Const

float

 

GetCostFromIndex

(
    int32 PathPointIndex
)

Returns approximate length of path, ignores parameter

Public function Virtual Const

float

 

GetLengthFromPosition

(
    FVector SegmentStart,
    uint32 NextPathPointIndex
)

Returns approximate length of path, ignores parameters

Typedefs

Name

Description

Super

Constants

Name

Description

Type

Deprecated Functions

Name Description

Public function Const

TArray< FVec...

 

GetWaypoints()

Waypoint type of MetaPaths has been changed. Use the new GetWaypointArray

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