Navigation
API > API/Runtime > API/Runtime/AIModule > API/Runtime/AIModule/Navigation
Inheritance Hierarchy
- TSimpleCellGrid
- FNavLocalGridData
- FCombinedNavGridData
References
| Module | AIModule |
| Header | /Engine/Source/Runtime/AIModule/Classes/Navigation/NavLocalGridData.h |
| Include | #include "Navigation/NavLocalGridData.h" |
Syntax
struct FNavLocalGridData : public TSimpleCellGrid< uint8,((uint8) 0xff) >
Remarks
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?
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< FVector::FReal > | CellZ | ||
| double | LastAccessTime |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FNavLocalGridData
(
const TArray< FNavLocalGridData >& SourceGrids |
|||
FNavLocalGridData
(
const FVector& Center, |
|||
FNavLocalGridData
(
const FVector& Center, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Create path points from StartCoords to EndCoord, returns false when failed | ||
| void | FindPathForMovingAgent
(
const FNavigationPath& SourcePath, |
Creates path points from navigation path going through grid | |
| int32 | GetCellIndexFromGlobalCoords2D
(
const FIntVector& WorldCoords |
Convert global world coords to cell index, return -1 if outside | |
| FIntVector | GetGlobalCoords
(
int32 CellIdx |
Convert cell index to global world coords with origin in (0,0,0) | |
| const int32 | GetGridId () |
Get unique Id of grid | |
| FNodeRef | GetNeighbour
(
const FNodeRef NodeRef, |
||
| int32 | GetNeighbourCount
(
FNodeRef NodeRef |
||
| FVector | GetProjectedCellCenter
(
int32 LocationX, |
Convert cell coords on grid to world location using projected heights | |
| FVector | GetProjectedCellCenter
(
int32 CellIdx |
Convert cell index to world location using projected heights | |
| bool | HasObstacleUnsafe
(
int32 LocationX, |
Check if there's an obstacle at cell coords | |
| bool | IsLineObstructed
(
const FIntVector& StartCoords, |
Check if line trace between local coords on grid hits any obstacles, doesn't validate coords! | |
| bool | IsValidRef
(
FNodeRef NodeRef |
||
| void | MarkBoxObstacle
(
const FVector& Center, |
Mark box (AABB or rotated) shape as obstacle | |
| void | MarkCapsuleObstacle
(
const FVector& Center, |
Mark capsule shape as obstacle | |
| void | MarkPointObstacle
(
const FVector& Center |
Mark single cell as obstacle | |
| void | PostProcessPath
(
const FIntVector& StartCoords, |
Convert PathIndices into pruned PathCoords | |
| void | ProjectCells
(
const ANavigationData& NavData |
Project cells on navigation data and marks failed ones as obstacles | |
| void | SetGridId
(
int32 NewId |
Set unique Id of grid | |
| void | SetHeight
(
float ExtentZ |
Set height of bounds, if not set: ProjectCells will use height of default query box |
Typedefs
| Name | Description |
|---|---|
| FNodeRef | FGraphAStar: TGraph. |