UNavLocalGridManager

Manager for local navigation grids

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UNavLocalGridManager

References

Module

AIModule

Header

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

Include

#include "Navigation/NavLocalGridManager.h"

Syntax

class UNavLocalGridManager : public UObject

Remarks

Manager for local navigation grids

Builds non overlapping grid from multiple sources, that can be used later for pathfinding. Check also: UGridPathFollowingComponent, FNavLocalGridData

Variables

Name Description

Protected variable

uint32: 1

 

bNeedsRebuilds

Protected variable

TArray< FCombin...

 

CombinedGrids

Protected variable

int32

 

MaxActiveSourceGrids

Protected variable

int32

 

NextGridId

Protected variable

TArray< FNavLoc...

 

SourceGrids

Protected variable

int32

 

VersionNum

Constructors

Name Description

Public function

UNavLocalGridManager

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

int32

 

AddGridData

(
    const FNavLocalGridData& GridData,
    bool bUpdate
)

Adds new grid

Public function Static

int32

 

AddLocalNavigationGridForBox

(
    UObject* WorldContextObject,
    const FVector& Location,
    FVector Extent,
    FRotator Rotation,
    const int32 Radius2D,
    const float Height,
    bool bRebuildGrids
)

Public function Static

int32

 

AddLocalNavigationGridForCapsule

(
    UObject* WorldContextObject,
    const FVector& Location,
    float CapsuleRadius,
    float CapsuleHalfHeight,
    const int32 Radius2D,
    const float Height,
    bool bRebuildGrids
)

Public function Static

int32

 

AddLocalNavigationGridForPoint

(
    UObject* WorldContextObject,
    const FVector& Location,
    const int32 Radius2D,
    const float Height,
    bool bRebuildGrids
)

Creates new grid data for single point

Public function Static

int32

 

AddLocalNavigationGridForPoints

(
    UObject* WorldContextObject,
    const TArray< FVector >& Locations,
    const int32 Radius2D,
    const float Height,
    bool bRebuildGrids
)

Creates single grid data for set of points

Public function Static

bool

 

FindLocalNavigationGridPath

(
    UObject* WorldContextObject,
    const FVector& Start,
    const FVector& End,
    TArray< FVector >& PathPoints
)

Public function Const

bool

 

FindPath

(
    const FVector& Start,
    const FVector& End,
    TArray< FVector >& PathPoints
)

Tries to find a path using grids, returns false when start and end locations are not on the same grid

Public function Static

float

 

GetCellSize()

Get shared size of grid cell, static but there's only one active manager

Public function Static

UNavLocalGri...

 

GetCurrent

(
    UWorld* World
)

Public function Static

UNavLocalGri...

 

GetCurrent

(
    const UObject* WorldContextObj...
)

Public function Const

const FNavLo...

 

GetGridData

(
    int32 GridIdx
)

Get combined, non overlapping grid by index

Public function Const

int32

 

GetGridIndex

(
    const FVector& WorldLocation
)

Find combined grid at location

Public function Const

uint8

 

GetGridValueAt

(
    const FVector& WorldLocation
)

Find combined grid value at world location

Public function Const

int32

 

GetMaxActiveSources()

Get limit of source grids

Public function Const

int32

 

GetNumGrids()

Get number of combined, non overlapping grids

Public function Const

int32

 

GetNumSources()

Get number of known source grids

Public function Const

const FNavLo...

 

GetSourceData

(
    int32 SourceIdx
)

Get source grid by index

Public function Const

int32

 

GetVersion()

Get version of grid data, incremented with each rebuild

Public function Const

bool

 

HasSourceGridLimit()

Check if source grid limit is set

Protected function Virtual

void

 

ProjectGrids

(
    const TArray< int32 >& GridIndices
)

Projects combined grids to navigation data

Public function

void

 

RebuildGrids()

Rebuild overlapping grids if needed

Public function

void

 

RemoveGridData

(
    int32 GridId,
    bool bUpdate
)

Removes grid

Public function Static

void

 

RemoveLocalNavigationGrid

(
    UObject* WorldContextObject,
    int32 GridId,
    bool bRebuildGrids
)

Public function

bool

 

SetCellSize

(
    float CellSize
)

Set shared size of grid cell, allowed only when there's no grid added

Public function Static

bool

 

SetLocalNavigationGridDensity

(
    UObject* WorldContextObject,
    float CellSize
)

Public function

void

 

SetMaxActiveSources

(
    int32 NumActiveSources
)

Set limit of source grids, 0 or negative means unlimited

Public function

void

 

UpdateAccessTime

(
    int32 CombinedGridIdx
)

Updates LastAccessTime in all source grids

Protected function

bool

 

UpdateSourceGrids()

Ensures limit of source grids, removing oldest entries (LastAccessTime)

Constants

Name

Description

GridCellSize