Navigation
API > API/Runtime > API/Runtime/AIModule
| Name | UPathFollowingComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/AIModule/Classes/Navigation/PathFollowingComponent.h |
| Include Path | #include "Navigation/PathFollowingComponent.h" |
Syntax
UCLASS (Config=Engine, MinimalAPI)
class UPathFollowingComponent :
public UActorComponent ,
public IAIResourceInterface ,
public IPathFollowingAgentInterface
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → UPathFollowingComponent
Implements Interfaces
- IAIResourceInterface
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IPathFollowingAgentInterface
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPathFollowingComponent
(
const FObjectInitializer& ObjectInitializer |
Navigation/PathFollowingComponent.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FMoveComplete | TMulticastDelegate_TwoParams< void, FAIRequestID, const FPathFollowingResult & > | Navigation/PathFollowingComponent.h | |
| FMoveCompletedSignature | TMulticastDelegate_TwoParams< void, FAIRequestID, EPathFollowingResult::Type > | Navigation/PathFollowingComponent.h | |
| FPostProcessMoveSignature | TBaseDelegate_TwoParams< void, UPathFollowingComponent *, FVector & > | Navigation/PathFollowingComponent.h | |
| FRequestCompletedSignature | TBaseDelegate_OneParam< void, EPathFollowingResult::Type > | Navigation/PathFollowingComponent.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DefaultAcceptanceRadius | const float | Special float constant to symbolize "use default value". | Navigation/PathFollowingComponent.h |
| NextRequestId | uint32 | Used for debugging purposes to be able to identify which logged information results from which request, if there was multiple ones during one frame | Navigation/PathFollowingComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DEBUG_bMovingDirectlyToGoal | uint8 | Navigation/PathFollowingComponent.h | ||
| OnRequestFinished | FMoveComplete | Delegate for move completion notify | Navigation/PathFollowingComponent.h | |
| PostProcessMove | FPostProcessMoveSignature | Delegate for modifying path following velocity | Navigation/PathFollowingComponent.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CurrentNavLocation | FNavLocation | Current location on navigation data. | Navigation/PathFollowingComponent.h | |
| CurrentRequestId | FAIRequestID | Navigation/PathFollowingComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AbortMove
(
const UObject& Instigator, |
Aborts following path | Navigation/PathFollowingComponent.h | |
virtual void Cleanup() |
Cleanup component before destroying | Navigation/PathFollowingComponent.h | |
virtual void DescribeSelfToVisLog
(
FVisualLogEntry* Snapshot |
Navigation/PathFollowingComponent.h | ||
bool DidMoveReachGoal() |
Navigation/PathFollowingComponent.h | ||
virtual void DisplayDebug
(
UCanvas* Canvas, |
Navigation/PathFollowingComponent.h | ||
virtual void FinishUsingCustomLink
(
INavLinkCustomInterface* CustomNavLink |
Call when moving agent finishes using custom nav link, returns control back to path following | Navigation/PathFollowingComponent.h | |
float GetAcceptanceRadius() |
Navigation/PathFollowingComponent.h | ||
UObject * GetCurrentCustomLinkOb() |
Navigation/PathFollowingComponent.h | ||
FVector GetCurrentDirection() |
Navigation/PathFollowingComponent.h | ||
FVector GetCurrentMoveInput() |
Note that CurrentMoveInput is only valid if MovementComp->UseAccelerationForPathFollowing() == true | Navigation/PathFollowingComponent.h | |
FNavLocation GetCurrentNavLocation() |
Returns current location on navigation data | Navigation/PathFollowingComponent.h | |
virtual int32 GetCurrentPathElement () |
Returns index of the currently followed element of path. | Navigation/PathFollowingComponent.h | |
uint32 GetCurrentPathIndex() |
Navigation/PathFollowingComponent.h | ||
FAIRequestID GetCurrentRequestId() |
Navigation/PathFollowingComponent.h | ||
FVector GetCurrentTargetLocation() |
Navigation/PathFollowingComponent.h | ||
FBasedPosition GetCurrentTargetLocationBased() |
Navigation/PathFollowingComponent.h | ||
virtual FString GetDebugString() |
Navigation/PathFollowingComponent.h | ||
virtual void GetDebugStringTokens
(
TArray< FString >& Tokens, |
Navigation/PathFollowingComponent.h | ||
float GetDefaultAcceptanceRadius() |
Navigation/PathFollowingComponent.h | ||
virtual FVector GetMoveFocus
(
bool bAllowStrafe |
Get current focal point of movement | Navigation/PathFollowingComponent.h | |
AActor * GetMoveGoal() |
Navigation/PathFollowingComponent.h | ||
FVector GetMoveGoalLocationOffset() |
Navigation/PathFollowingComponent.h | ||
uint32 GetNextPathIndex() |
Navigation/PathFollowingComponent.h | ||
const FNavPathSharedPtr GetPath() |
Navigation/PathFollowingComponent.h | ||
EPathFollowingAction::Type GetPathActionType() |
Navigation/PathFollowingComponent.h |
|
|
FVector GetPathDestination() |
Navigation/PathFollowingComponent.h |
|
|
FVector::FReal GetRemainingPathCost() |
Navigation/PathFollowingComponent.h | ||
FString GetResultDesc
(
EPathFollowingResult::Type Result |
Readable name of result enum | Navigation/PathFollowingComponent.h | |
EPathFollowingStatus::Type GetStatus() |
Navigation/PathFollowingComponent.h | ||
FString GetStatusDesc() |
Readable name of current status | Navigation/PathFollowingComponent.h | |
bool HasDirectPath() |
Navigation/PathFollowingComponent.h | ||
bool HasMovementAuthority() |
Check if path following has authority over movement (e.g. not falling) and can update own state | Navigation/PathFollowingComponent.h | |
bool HasPartialPath() |
Navigation/PathFollowingComponent.h | ||
bool HasReached
(
const AActor& TestGoal, |
Simple test for stationary agent (used as early finish condition), check if reached given goal | Navigation/PathFollowingComponent.h | |
bool HasReached
(
const FVector& TestPoint, |
Simple test for stationary agent (used as early finish condition), check if reached given point | Navigation/PathFollowingComponent.h | |
bool HasReached
(
const FAIMoveRequest& MoveRequest |
Simple test for stationary agent (used as early finish condition), check if reached target specified in move request | Navigation/PathFollowingComponent.h | |
bool HasStartedNavLinkMove() |
Navigation/PathFollowingComponent.h | ||
bool HasValidPath() |
Navigation/PathFollowingComponent.h | ||
virtual void Initialize() |
Initialize component to use | Navigation/PathFollowingComponent.h | |
bool IsBlockDetectionActive() |
Navigation/PathFollowingComponent.h | ||
bool IsCurrentSegmentNavigationLink() |
Navigation/PathFollowingComponent.h | ||
bool IsDecelerating() |
Returns true if pathfollowing is doing deceleration at the end of the path. | Navigation/PathFollowingComponent.h | |
virtual bool IsFollowingNavLink() |
Navigation/PathFollowingComponent.h | ||
virtual bool IsPathFollowingAllowed() |
Check if path following can be activated | Navigation/PathFollowingComponent.h | |
bool IsStopMovementOnFinishActive() |
Navigation/PathFollowingComponent.h | ||
virtual void OnActorBump
(
AActor* SelfActor, |
Called when moving agent collides with another actor | Navigation/PathFollowingComponent.h | |
virtual void OnLanded() |
Navigation/PathFollowingComponent.h | ||
void OnPathEvent
(
FNavigationPath* InPath, |
Path observer | Navigation/PathFollowingComponent.h | |
virtual void OnPathfindingQuery
(
FPathFindingQuery& Query |
Called when owner is preparing new pathfinding request | Navigation/PathFollowingComponent.h | |
virtual void OnPathFinished
(
const FPathFollowingResult& Result |
Notify about finished movement | Navigation/PathFollowingComponent.h | |
void OnPathFinished
(
EPathFollowingResult::Type ResultCode, |
Navigation/PathFollowingComponent.h | ||
virtual void OnPathUpdated() |
Notify about changing current path: new pointer or update from path event | Navigation/PathFollowingComponent.h | |
virtual void OnSegmentFinished() |
Notify about finishing move along current path segment | Navigation/PathFollowingComponent.h | |
virtual void OnStartedFalling() |
Navigation/PathFollowingComponent.h | ||
virtual void OnUnableToMove
(
const UObject& Instigator |
Navigation/PathFollowingComponent.h | ||
virtual void PauseMove
(
FAIRequestID RequestID, |
Pause path following | Navigation/PathFollowingComponent.h | |
virtual FAIRequestID RequestMove
(
const FAIMoveRequest& RequestData, |
Start movement along path | Navigation/PathFollowingComponent.h | |
FAIRequestID RequestMoveWithImmediateFinish
(
EPathFollowingResult::Type Result, |
Create new request and finish it immediately (e.g. already at goal) | Navigation/PathFollowingComponent.h | |
virtual void ResumeMove
(
FAIRequestID RequestID |
Resume path following | Navigation/PathFollowingComponent.h | |
void SetAcceptanceRadius
(
const float InAcceptanceRadius |
Navigation/PathFollowingComponent.h | ||
void SetBlockDetection
(
float DistanceThreshold, |
Set block detection params | Navigation/PathFollowingComponent.h | |
void SetBlockDetectionState
(
bool bEnable |
Update state of block detection | Navigation/PathFollowingComponent.h | |
void SetDestinationActor
(
const AActor* InDestinationActor |
Navigation/PathFollowingComponent.h | ||
void SetLastMoveAtGoal
(
bool bFinishedAtGoal |
Set status of last requested move, works only in Idle state | Navigation/PathFollowingComponent.h | |
virtual void SetMovementComponent
(
UNavMovementComponent* MoveComp |
Set associated movement component. | Navigation/PathFollowingComponent.h | |
virtual void SetNavMovementInterface
(
INavMovementInterface* NavMoveInterface |
Set associated nav movement interface | Navigation/PathFollowingComponent.h | |
void SetPreciseReachThreshold
(
float AgentRadiusMultiplier, |
Set threshold for precise reach tests in intermediate goals (minimal test radius) | Navigation/PathFollowingComponent.h | |
void SetStopMovementOnFinish
(
bool bEnable |
Set whether movement is stopped on finish of move. | Navigation/PathFollowingComponent.h | |
virtual void UpdateCachedComponents() |
Updates cached pointers to relevant owner's components | Navigation/PathFollowingComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnRegister() |
Navigation/PathFollowingComponent.h | ||
virtual void TickComponent
(
float DeltaTime, |
Navigation/PathFollowingComponent.h |
Overridden from IAIResourceInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ClearResourceLock
(
EAIRequestPriority::Type LockSource |
Clear resource lock of the given origin | Navigation/PathFollowingComponent.h | |
virtual void ForceUnlockResource() |
Force-clears all locks on resource | Navigation/PathFollowingComponent.h | |
virtual bool IsResourceLocked() |
Check whether resource is currently locked | Navigation/PathFollowingComponent.h | |
virtual void LockResource
(
EAIRequestPriority::Type LockSource |
If resource is lockable lock it with indicated priority | Navigation/PathFollowingComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void DebugReachTest
(
float& CurrentDot, |
Debug point reach test values | Navigation/PathFollowingComponent.h | |
virtual int32 DetermineCurrentTargetPathPoint
(
int32 StartIndex |
Navigation/PathFollowingComponent.h | ||
virtual int32 DetermineStartingPathPoint
(
const FNavigationPath* ConsideredPath |
Checks if this PathFollowingComponent is already on path, and if so determines index of next path point | Navigation/PathFollowingComponent.h | |
FSharedConstNavQueryFilter ExtractNavigationFilter
(
const FAIMoveRequest& RequestData, |
Extract the navigation filter that should be used based on the provided MoveRequest and NavPath | Navigation/PathFollowingComponent.h | |
int32 FindPreciseAcceptanceRadiusTestsStartNodeIndex
(
const FNavigationPath& PathInstance, |
For given path finds a path node at which PathfollowingComponent should start doing precise is-goal-in-acceptance-radius tests | Navigation/PathFollowingComponent.h | |
virtual void FollowPathSegment
(
float DeltaTime |
Follow current path segment | Navigation/PathFollowingComponent.h | |
void ForceBlockDetectionUpdate() |
Force creating new location sample for block detection | Navigation/PathFollowingComponent.h | |
float GetFinalAcceptanceRadius
(
const FNavigationPath& PathInstance, |
Based on Path's properties, original move goal location and requested AcceptanceRadius this function calculates actual acceptance radius to apply when testing if the agent has successfully reached requested goal's vicinity | Navigation/PathFollowingComponent.h | |
virtual bool HandlePathUpdateEvent() |
Called after receiving update event from current path | Navigation/PathFollowingComponent.h | |
virtual bool HasReachedCurrentTarget
(
const FVector& CurrentLocation |
Check if segment is completed | Navigation/PathFollowingComponent.h | |
virtual bool HasReachedDestination
(
const FVector& CurrentLocation |
Check if move is completed | Navigation/PathFollowingComponent.h | |
bool HasReachedInternal
(
const FVector& GoalLocation, |
Check if moving agent has reached goal defined by cylinder | Navigation/PathFollowingComponent.h | |
bool IsBlocked() |
Check if movement is blocked | Navigation/PathFollowingComponent.h | |
virtual bool IsOnPath() |
Check if agent is on path | Navigation/PathFollowingComponent.h | |
void OnNavDataRegistered
(
ANavigationData* NavData |
Called when NavigationSystem registers new navigation data type while this component instance has empty MyNavData. | Navigation/PathFollowingComponent.h | |
virtual void OnNavigationInitDone () |
Called when NavigationSystem finishes initial navigation data registration. | Navigation/PathFollowingComponent.h | |
| Called if owning Controller possesses new pawn or ends up pawn-less. | Navigation/PathFollowingComponent.h | ||
virtual void OnWaitingPathTimeout() |
Called from timer if component spends too much time in Waiting state | Navigation/PathFollowingComponent.h | |
virtual void Reset() |
Reset path following data | Navigation/PathFollowingComponent.h | |
void ResetBlockDetectionData() |
Clears Block Detection stored data effectively resetting the mechanism | Navigation/PathFollowingComponent.h | |
void ResetMoveSegmentCustomLinkCache() |
Reset the cached information about CustomLinks on the next MoveSegment | Navigation/PathFollowingComponent.h | |
virtual void SetMoveSegment
(
int32 SegmentStartIndex |
Sets variables related to current move segment | Navigation/PathFollowingComponent.h | |
void SetNextMoveSegment() |
Switch to next segment on path | Navigation/PathFollowingComponent.h | |
void SetStatus
(
EPathFollowingStatus::Type InStatus |
Sets the current status and activates/deactivates the component if necessary | Navigation/PathFollowingComponent.h | |
virtual bool ShouldCheckPathOnResume() |
Should verify if agent if still on path ater movement has been resumed? | Navigation/PathFollowingComponent.h | |
virtual bool ShouldStopMovementOnPathFinished() |
Defines if the agent should reset his velocity when the path is finished | Navigation/PathFollowingComponent.h | |
virtual void StartUsingCustomLink
(
INavLinkCustomInterface* CustomNavLink, |
Next path segment if custom nav link, try passing control to it | Navigation/PathFollowingComponent.h | |
void StoreRequestId() |
Assign new request Id | Navigation/PathFollowingComponent.h | |
virtual bool UpdateBlockDetection() |
Update blocked movement detection, | Navigation/PathFollowingComponent.h | |
virtual void UpdateDecelerationData() |
Updates braking distance and deceleration segment | Navigation/PathFollowingComponent.h | |
virtual void UpdateMoveFocus() |
Set move focus in AI owner | Navigation/PathFollowingComponent.h | |
virtual bool UpdateMovementComponent
(
bool bForce |
Check if movement component is valid or tries to grab one from owner | Navigation/PathFollowingComponent.h | |
virtual void UpdatePathSegment() |
Check state of path following, update move segment if needed | Navigation/PathFollowingComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static uint32 GetNextRequestId() |
Navigation/PathFollowingComponent.h | ||
static void LogPathHelper
(
const AActor* LogOwner, |
Navigation/PathFollowingComponent.h | ||
static void LogPathHelper
(
const AActor* LogOwner, |
Helper function for sending a path for visual log | Navigation/PathFollowingComponent.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnMoveFinished_DEPRECATED | FMoveCompletedSignature | This delegate is now deprecated, please use OnRequestFinished instead. | Navigation/PathFollowingComponent.h |