Navigation
API > API/Runtime > API/Runtime/AIModule > API/Runtime/AIModule/Navigation
Inheritance Hierarchy
- TSharedFromThis
- FNavigationPath
- FNavMeshPath
- FMetaNavMeshPath
References
| Module | AIModule |
| Header | /Engine/Source/Runtime/AIModule/Classes/Navigation/MetaNavMeshPath.h |
| Include | #include "Navigation/MetaNavMeshPath.h" |
Syntax
struct FMetaNavMeshPath : public FNavMeshPath
Remarks
FMetaNavMeshPath allows creating hierarchical or guided navmesh paths
Waypoints array defines list of locations that will be used to create actual FNavMeshPath data during path following. On path following start and upon reaching waypoint, path will request update from owning navmesh with following parameters:
- start location set to agent location
- end location set to target waypoint (or goal actor for last one)
- goal actor set only for last section
Since path updates itself for moving agent it really shouldn't be reused by others.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FVector::FReal | ApproximateLength | Sum of 3D distance along waypoints, used for approximating length of path | |
| TWeakObjectPtr< AActor > | PathGoal | Stored goal actor | |
| float | PathGoalTetherDistance | Stored goal actor's tether distance | |
| int32 | TargetWaypointIdx | Current target of path following | |
| TArray< FMetaPathWayPoint > | Waypoints | List of waypoints, including start and end of path | |
| float | WaypointSwitchRadius | Update navmesh path when this close to target waypoint |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FMetaNavMeshPath
(
const TArray< FMetaPathWayPoint >& InWaypoints, |
|||
FMetaNavMeshPath
(
const TArray< FMetaPathWayPoint >& InWaypoints, |
|||
FMetaNavMeshPath
(
const TArray< FVector >& InWaypoints, |
|||
FMetaNavMeshPath
(
const TArray< FVector >& InWaypoints, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | ConditionalMoveToNextSection
(
const FVector& AgentLocation, |
Try switching to next waypoint, depends on WaypointSwitchRadius | |
| void | CopyFrom
(
const FMetaNavMeshPath& Other |
Copy properties of other meta path | |
| bool | ForceMoveToNextSection
(
const FVector& AgentLocation |
Force switching to next waypoint | |
| AActor * | Returns cached path goal | ||
| int32 | Returns number of waypoints | ||
| int32 | Returns index of current target waypoint | ||
| const TArray< FMetaPathWayPoint > & | Returns waypoint array | ||
| float | Returns radius for switching to next waypoint during path following | ||
| void | Initialize
(
const FVector& AgentLocation |
Initialize path for path following | |
| bool | Returns true if path at last waypoint | ||
| bool | MoveToNextSection
(
const FVector& AgentLocation |
Switch to next waypoint | |
| bool | SetWaypoints
(
const TArray< FMetaPathWayPoint >& InWaypoints |
Tries to set waypoints, fails when path is ready being followed | |
| bool | SetWaypoints
(
const TArray< FVector >& InWaypoints |
Tries to set waypoints, fails when path is ready being followed | |
| void | SetWaypointSwitchRadius
(
float InSwitchRadius |
Sets radius for switching to next waypoint during path following | |
| bool | UpdatePath
(
const FVector& AgentLocation |
Updates underlying navmesh path for current target waypoint |
Overridden from FNavigationPath
| Type | Name | Description | |
|---|---|---|---|
| void | DebugDraw
(
const ANavigationData* NavData, |
||
| void | DescribeSelfToVisLog
(
FVisualLogEntry* Snapshot |
||
| FVector::FReal | GetCostFromIndex
(
int32 PathPointIndex |
Returns approximate cost of path, ignores parameter | |
| FVector::FReal | GetLengthFromPosition
(
FVector SegmentStart, |
Returns approximate length of path, ignores parameters |
Typedefs
| Name | Description |
|---|---|
| Super |
Constants
| Name | Description |
|---|---|
| Type |