Navigation
API > API/Runtime > API/Runtime/AIModule
Local navigation grid - simple 2D grid used for navigation.
Cell can be either free or marked as obstacle, connected with 8 neighbors (no walls in between)
When used as source for UNavLocalGridManager, each obstacle should define its own grid data. Corresponding category in gameplay debugger is hidden by default, please adjust project configs to change that.
TODO: helpers for marking different basic shapes TODO: serialization (with maps?) TODO: FNavigationPath support?
| Name | FNavLocalGridData |
| Type | struct |
| Header File | /Engine/Source/Runtime/AIModule/Classes/Navigation/NavLocalGridData.h |
| Include Path | #include "Navigation/NavLocalGridData.h" |
Syntax
struct FNavLocalGridData : public TSimpleCellGrid< uint8, 0xff) >
Inheritance Hierarchy
- TSimpleCellGrid → FNavLocalGridData
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FNavLocalGridData
(
const FVector& Center, |
Navigation/NavLocalGridData.h | ||
FNavLocalGridData
(
const FVector& Center, |
Navigation/NavLocalGridData.h | ||
FNavLocalGridData
(
const TArray< FNavLocalGridData >& SourceGrids |
Navigation/NavLocalGridData.h | ||
| Navigation/NavLocalGridData.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FNodeRef | int32 | FGraphAStar: TGraph. | Navigation/NavLocalGridData.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| GridId | int32 | Navigation/NavLocalGridData.h | ||
| OriginWorldCoord | FIntVector | Navigation/NavLocalGridData.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool FindPath
(
const FIntVector& StartCoords, |
Create path points from StartCoords to EndCoord, returns false when failed | Navigation/NavLocalGridData.h | |
void FindPathForMovingAgent
(
const FNavigationPath& SourcePath, |
Creates path points from navigation path going through grid | Navigation/NavLocalGridData.h | |
int32 GetCellIndexFromGlobalCoords2D
(
const FIntVector& WorldCoords |
Convert global world coords to cell index, return -1 if outside | Navigation/NavLocalGridData.h | |
FIntVector GetGlobalCoords
(
int32 CellIdx |
Convert cell index to global world coords with origin in (0,0,0) | Navigation/NavLocalGridData.h | |
const int32 GetGridId() |
Get unique Id of grid | Navigation/NavLocalGridData.h | |
FNodeRef GetNeighbour
(
const FNodeRef NodeRef, |
Navigation/NavLocalGridData.h | ||
int32 GetNeighbourCount
(
FNodeRef NodeRef |
Navigation/NavLocalGridData.h | ||
FVector GetProjectedCellCenter
(
int32 LocationX, |
Convert cell coords on grid to world location using projected heights | Navigation/NavLocalGridData.h | |
FVector GetProjectedCellCenter
(
int32 CellIdx |
Convert cell index to world location using projected heights | Navigation/NavLocalGridData.h | |
bool HasObstacleUnsafe
(
int32 LocationX, |
Check if there's an obstacle at cell coords | Navigation/NavLocalGridData.h | |
bool IsValidRef
(
FNodeRef NodeRef |
Navigation/NavLocalGridData.h | ||
void MarkBoxObstacle
(
const FVector& Center, |
Mark box (AABB or rotated) shape as obstacle | Navigation/NavLocalGridData.h | |
void MarkCapsuleObstacle
(
const FVector& Center, |
Mark capsule shape as obstacle | Navigation/NavLocalGridData.h | |
void MarkPointObstacle
(
const FVector& Center |
Mark single cell as obstacle | Navigation/NavLocalGridData.h | |
void ProjectCells
(
const ANavigationData& NavData |
Project cells on navigation data and marks failed ones as obstacles | Navigation/NavLocalGridData.h | |
void SetHeight
(
float ExtentZ |
Set height of bounds, if not set: ProjectCells will use height of default query box | Navigation/NavLocalGridData.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool IsLineObstructed
(
const FIntVector& StartCoords, |
Check if line trace between local coords on grid hits any obstacles, doesn't validate coords! | Navigation/NavLocalGridData.h | |
| Convert PathIndices into pruned PathCoords | Navigation/NavLocalGridData.h | ||
void SetGridId
(
int32 NewId |
Set unique Id of grid | Navigation/NavLocalGridData.h |