ANavigationData

Represents abstract Navigation Data (sub-classed as NavMesh, NavGraph, etc) Used as a common interface for all navigation types handled by NavigationSystem

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

NavigationSystem

Header

/Engine/Source/Runtime/NavigationSystem/Public/NavigationData.h

Include

#include "NavigationData.h"

Syntax

class ANavigationData :
    public AActor,
    public INavigationDataInterface

Remarks

Represents abstract Navigation Data (sub-classed as NavMesh, NavGraph, etc) Used as a common interface for all navigation types handled by NavigationSystem

Variables

Name Description

Protected variable

TArray< FNavPat...

 

ActivePaths

Container for all path objects generated with this Navigation Data instance.

Protected variable

TMap< const UCl...

 

AreaClassToIdMap

Mapping for SupportedAreas

Protected variable

uint32: 1

 

bAutoDestroyWhenNoNavigation

Should this instance auto-destroy when there's no navigation system on world when it gets created/loaded

Protected variable

uint32: 1

 

bCanBeMainNavData

If set, navigation data can act as default one in navigation system's queries

Protected variable

uint32: 1

 

bCanSpawnOnRebuild

If set, navigation data will be spawned in persistent level during rebuild if actor doesn't exist

Protected variable

uint32: 1

 

bEnableDrawing

If set to true then this navigation data will be drawing itself when requested as part of "show navigation"

Protected variable

uint32: 1

 

bForceRebuildOnLoad

Game-time config

Protected variable

uint32: 1

 

bRebuildingSuspended

Set via SetRebuildingSuspended and controlling if RebuildDirtyAreas get passed over to the generator instantly or cached in SuspendedDirtyAreas to be applied at later date with SetRebuildingSuspended(false) call

Protected variable

uint32: 1

 

bRegistered

Whether this instance is registered with Navigation System

Protected variable

uint32: 1

 

bSupportsDefaultAgent

Was it generated for default agent (SupportedAgents[0])

Protected variable

uint32

 

DataVersion

Navigation data versioning.

Protected variable

FSharedNavQuery...

 

DefaultQueryFilter

Query filter used when no other has been passed to relevant functions

Protected variable

FFindPathPtr

 

FindHierarchicalPathImplementation

Protected variable

FFindPathPtr

 

FindPathImplementation

Protected variable

FNavDataConfig

 

NavDataConfig

Protected variable

TSharedPtr< FNa...

 

NavDataGenerator

Protected variable

float

 

NextObservedPathsTickInSeconds

Contains how much time left to the next ObservedPaths processing

Protected variable

TArray< FNavPat...

 

ObservedPaths

Contains paths that requested observing its goal's location.

Protected variable

float

 

ObservedPathsTickInterval

All observed paths will be processed every ObservedPathsTickInterval seconds

Protected variable

TMap< UClass &#...

 

QueryFilters

Map of query filters by UNavigationQueryFilter class

Protected variable

FNavRaycastPtr

 

RaycastImplementation

Public variable

UPrimitiveCompo...

 

RenderingComp

Protected variable

TArray< FNavPat...

 

RepathRequests

Paths that requested re-calculation

Protected variable

ERuntimeGenerat...

 

RuntimeGeneration

Navigation data runtime generation options

Protected variable

TArray< FSuppor...

 

SupportedAreas

Serialized area class - ID mapping

Protected variable

TArray< FNaviga...

 

SuspendedDirtyAreas

Caches requests to rebuild dirty areas while nav rebuilding is suspended via SetRebuildingSuspended(true) call.

Protected variable

FTestPathPtr

 

TestHierarchicalPathImplementation

Protected variable

FTestPathPtr

 

TestPathImplementation

Constructors

Name Description

Public function

ANavigationData

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual Const

void

 

BatchProjectPoints

(
    TArray< FNavigationProjectionWork >...,
    FSharedConstNavQueryFilter Filter,
    const UObject* Querier
)

Project batch of points using shared search filter.

Public function Virtual Const

void

 

BatchProjectPoints

(
    TArray< FNavigationProjectionWork >...,
    const FVector& Extent,
    FSharedConstNavQueryFilter Filter,
    const UObject* Querier
)

Batches ProjectPoint's work for efficiency

Public function Virtual Const

void

 

BatchRaycast

(
    TArray< FNavigationRaycastWork >& ...,
    FSharedConstNavQueryFilter QueryFil...,
    const UObject* Querier
)

Raycasts batched for efficiency

Public function Virtual Const

void

 

BeginBatchQuery()

Batch processing (important with async rebuilding)

Public function Virtual Const

ENavigationQ...

 

CalcPathCost

(
    const FVector& PathStart,
    const FVector& PathEnd,
    float& OutPathCost,
    FSharedConstNavQueryFilter QueryFil...,
    const UObject* Querier
)

Calculates path from PathStart to PathEnd and retrieves its cost.

Public function Virtual Const

ENavigationQ...

 

CalcPathLength

(
    const FVector& PathStart,
    const FVector& PathEnd,
    float& OutPathLength,
    FSharedConstNavQueryFilter QueryFil...,
    const UObject* Querier
)

Calculates path from PathStart to PathEnd and retrieves its length.

Public function Virtual Const

ENavigationQ...

 

CalcPathLengthAndCost

(
    const FVector& PathStart,
    const FVector& PathEnd,
    float& OutPathLength,
    float& OutPathCost,
    FSharedConstNavQueryFilter QueryFil...,
    const UObject* Querier
)

Calculates path from PathStart to PathEnd and retrieves its length.

Public function Const

bool

 

CanBeMainNavData()

Public function Virtual

void

 

CancelBuild()

Cancels current build

Public function Const

bool

 

CanSpawnOnRebuild()

Public function Virtual

void

 

CleanUp()

Public function Virtual

void

 

CleanUpAndMarkPendingKill()

Public function Virtual

void

 

ConditionalConstructGenerator()

Creates new generator in case navigation supports it

Public function Virtual

UPrimitiveCo...

 

ConstructRenderingComponent()

All the rest

Public function Const

FNavPathShar...

 

CreatePathInstance

(
    const FPathFindingQueryData& Query...
)

Created an instance of navigation path of specified type.

Public function Virtual Const

bool

 

DoesNodeContainLocation

(
    NavNodeRef NodeRef,
    const FVector& WorldSpaceLocation
)

Checks if specified navigation node contains given location

Public function Virtual Const

bool

 

DoesSupportAgent

(
    const FNavAgentProperties& AgentPr...
)

Public function Const

void

 

DrawDebugPath

(
    FNavigationPath* Path,
    FColor PathColor,
    UCanvas* Canvas,
    bool bPersistent,
    const uint32 NextPathPointIndex
)

Debug.

Public function Virtual

void

 

EnsureBuildCompletion()

Blocks until navigation build is complete

Protected function Virtual

void

 

FillConfig

(
    FNavDataConfig& Dest
)

Public function Const

FPathFinding...

 

FindHierarchicalPath

(
    const FNavAgentProperties& AgentPr...,
    const FPathFindingQuery& Query
)

Synchronously looks for a path from to for agent with properties .

Public function Const

FPathFinding...

 

FindPath

(
    const FNavAgentProperties& AgentPr...,
    const FPathFindingQuery& Query
)

Synchronously looks for a path from to for agent with properties .

Public function Virtual Const

void

 

FinishBatchQuery()

Finishes batch processing and release locks

Public function Const

const UClass...

 

GetAreaClass

(
    int32 AreaID
)

Get class associated with AreaID

Public function Const

int32

 

GetAreaID

(
    const UClass* AreaClass
)

Get ID assigned to AreaClas or -1 when not assigned

Public function Virtual Const

FBox

 

GetBounds()

Returns bounding box for the navmesh.

Public function Const

const FNavDa...

 

GetConfig()

Generation & data access.

Public function Const

FVector

 

GetDefaultQueryExtent()

Public function Const

FSharedConst...

 

GetDefaultQueryFilter()

Querying.

Public function Const

const INavig...

 

GetDefaultQueryFilterImpl()

Public function

FNavDataGene...

 

GetGenerator()

Retrieves navmesh's generator

Public function Const

const FNavDa...

 

GetGenerator()

Public function Virtual Const

int32

 

GetMaxSupportedAreas()

Get max areas supported by this navigation data

Public function Const

uint16

 

GetNavDataUniqueID()

Public function Const

TArray< FBox...

 

GetNavigableBounds()

Returns list of navigable bounds.

Public function Const

TArray< FBox...

 

GetNavigableBoundsInLevel

(
    ULevel* InLevel
)

Returns list of navigable bounds that belongs to specific level

Protected function Virtual Const

int32

 

GetNewAreaID

(
    const UClass* AreaClass
)

Get ID to assign for newly added area

Public function Const

FSharedConst...

 

GetQueryFilter

Filters.

Public function Virtual Const

FNavLocation

 

GetRandomPoint

(
    FSharedConstNavQueryFilter Filter,
    const UObject* Querier
)

Public function Virtual Const

bool

 

GetRandomPointInNavigableRadius

(
    const FVector& Origin,
    float Radius,
    FNavLocation& OutResult,
    FSharedConstNavQueryFilter Filter,
    const UObject* Querier
)

Finds a random location in navigable space, in given Radius

Public function Virtual Const

bool

 

GetRandomReachablePointInRadius

(
    const FVector& Origin,
    float Radius,
    FNavLocation& OutResult,
    FSharedConstNavQueryFilter Filter,
    const UObject* Querier
)

Finds a random location in Radius, reachable from Origin

Public function Const

ERuntimeGene...

 

GetRuntimeGenerationMode()

Public function Const

void

 

GetSupportedAreas

(
    TArray< FSupportedAreaData >& Area...
)

Read all supported areas

Public function Const

float

 

GetWorldTimeStamp()

Protected function

void

 

InstantiateAndRegisterRenderingComponent()

Public function Const

bool

 

IsAreaAssigned

(
    int32 AreaID
)

Check if AreaID was assigned to class (class itself may not be loaded yet!)

Public function Const

bool

 

IsDrawingEnabled()

Public function Const

bool

 

IsRegistered()

Public function Const

bool

 

IsSupportingDefaultAgent()

Public function Virtual Const

uint32

 

LogMemUsed()

Public function Virtual Const

bool

 

NeedsRebuild()

Public function Const

bool

 

NeedsRebuildOnLoad()

Public function Virtual

void

 

OnNavAreaAdded

(
    const UClass* NavAreaClass,
    int32 AgentIndex
)

Areas.

Public function Virtual

void

 

OnNavAreaChanged()

Called after changes to registered area classes

Public function

void

 

OnNavAreaEvent

(
    const UClass* NavAreaClass,
    ENavAreaEvent::Type Event
)

Public function Virtual

void

 

OnNavAreaRemoved

(
    const UClass* NavAreaClass
)

Area was removed from navigation system

Public function Virtual

void

 

OnNavigationBoundsChanged()

Public function Virtual

void

 

OnRegistered()

Public function Virtual

void

 

OnStreamingLevelAdded

(
    ULevel* InLevel,
    UWorld* InWorld
)

Public function Virtual

void

 

OnStreamingLevelRemoved

(
    ULevel* InLevel,
    UWorld* InWorld
)

Public function

void

 

OnUnregistered()

Public function

void

 

ProcessNavAreas

(
    const TSet< const UClass* >& ...,
    int32 AgentIndex
)

Add all existing areas

Protected function

void

 

PurgeUnusedPaths()

Removes from ActivePaths all paths that no longer have shared references (and are invalid in fact)

Public function Const

bool

 

Raycast

(
    const FVector& RayStart,
    const FVector& RayEnd,
    FVector& HitLocation,
    FSharedConstNavQueryFilter QueryFil...,
    const UObject* Querier
)

Synchronously makes a raycast on navigation data using QueryFilter

Public function Virtual

void

 

RebuildAll()

Triggers rebuild in case navigation supports it

Public function Virtual

void

 

RebuildDirtyAreas

(
    const TArray< FNavigationDirtyArea ...
)

Request navigation data update after changes in nav octree

Protected function

void

 

RegisterActivePath

(
    FNavPathSharedPtr SharedPath
)

Protected function

void

 

RegisterAsNavAreaClassObserver()

Releases navigation generator if any has been created register self with navigation system as new NavAreaDefinition(s) observer

Public function

void

 

RegisterObservedPath

(
    FNavPathSharedPtr SharedPath
)

Public function

void

 

RemoveQueryFilter

Removes cached query filter

Protected function

void

 

RequestRegistration()

Public function

void

 

RequestRePath

(
    FNavPathSharedPtr Path,
    ENavPathUpdateType::Type Reason
)

Public function Virtual

void

 

RestrictBuildingToActiveTiles

(
    bool InRestrictBuildingToActiveTile...
)

Public function Virtual

void

 

SetConfig

(
    const FNavDataConfig& Src
)

Public function

void

 

SetNavRenderingEnabled

(
    bool bEnable
)

Updates state of rendering component

Public function Virtual

void

 

SetRebuildingSuspended

(
    const bool bNewSuspend
)

Configures this NavData instance's navigation generation to be suspended or active.

Public function

void

 

SetSupportsDefaultAgent

(
    bool bIsDefault
)

Public function

void

 

StoreQueryFilter

Store cached query filter

Public function Virtual Const

bool

 

SupportsRuntimeGeneration()

Public function Virtual Const

bool

 

SupportsStreaming()

Public function Const

bool

 

TestHierarchicalPath

(
    const FNavAgentProperties& AgentPr...,
    const FPathFindingQuery& Query,
    int32* NumVisitedNodes
)

Synchronously checks if path between two points exists using hierarchical graph FNavAgentProperties will be found automatically

Public function Const

bool

 

TestPath

(
    const FNavAgentProperties& AgentPr...,
    const FPathFindingQuery& Query,
    int32* NumVisitedNodes
)

Synchronously checks if path between two points exists FNavAgentProperties will be found automatically

Public function Virtual

void

 

TickAsyncBuild

(
    float DeltaSeconds
)

Ticks navigation build

Public function Virtual

void

 

UpdateCustomLink

(
    const INavLinkCustomInterface*...
)

Custom navigation links.

Overridden from AActor

Name Description

Public function Virtual

void

 

ApplyWorldOffset

(
    const FVector& InOffset,
    bool bWorldShift
)

Called by owning level to shift an actor location and all relevant data structures by specified delta

Public function Virtual

void

 

Destroyed()

Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending

Public function Virtual

void

 

EndPlay

(
    const EEndPlayReason::Type EndPlayR...
)

Overridable function called whenever this actor is being removed from a level

Public function Virtual

void

 

PostInitializeComponents()

Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay

Public function Virtual

void

 

RerunConstructionScripts()

Rerun construction scripts, destroying all autogenerated components; will attempt to preserve the root component location.

Public function Virtual

void

 

TickActor

(
    float DeltaTime,
    enum ELevelTick TickType,
    FActorTickFunction& ThisTickFuncti...
)

Dispatches the once-per frame Tick() function for this actor

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Life cycle.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Overridden from INavigationDataInterface

Name Description

Public function Virtual Const

bool

 

ProjectPoint

(
    const FVector& Point,
    FNavLocation& OutLocation,
    const FVector& Extent,
    FSharedConstNavQueryFilter Filter,
    const UObject* Querier
)

Tries to project given Point to this navigation type, within given Extent.

Typedefs

Deprecated Variables

Name Description

Protected variable

uint32: 1

 

bRebuildAtRuntime_DEPRECATED

If true, the NavMesh can be dynamically rebuilt at runtime.

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