Navigation
API > API/Runtime > API/Runtime/AIModule > API/Runtime/AIModule/Navigation
Inheritance Hierarchy
- UActorComponent
- IAIResourceInterface
- IPathFollowingAgentInterface
- UPathFollowingComponent
- UCrowdFollowingComponent
References
| Module | AIModule |
| Header | /Engine/Source/Runtime/AIModule/Classes/Navigation/CrowdFollowingComponent.h |
| Include | #include "Navigation/CrowdFollowingComponent.h" |
Syntax
UCLASS (BlueprintType, MinimalAPI)
class UCrowdFollowingComponent :
public UPathFollowingComponent ,
public ICrowdAgentInterface
Variables
| Type | Name | Description | |
|---|---|---|---|
| TWeakInterfacePtr< IRVOAvoidanceInterface > | AvoidanceInterface | ||
| TEnumAsByte< ECrowdAvoidanceQuality::Type > | AvoidanceQuality | ||
| float | AvoidanceRangeMultiplier | Multiplier for avoidance samples during detection, doesn't affect actual velocity | |
| uint8: 1 | bAffectFallingVelocity | If set, velocity will be updated even if agent is falling | |
| uint8: 1 | bCanCheckMovingTooFar | If set, destination overshot can be tested | |
| uint8: 1 | bCanUpdatePathPartInTick | If set, path parts can be switched in UpdatePathSegment, based on distance | |
| uint8: 1 | bCheckMovementAngle | If set, movement will be finished when velocity is opposite to path direction (runtime flag) | |
| uint8: 1 | bEnableAnticipateTurns | ||
| uint8: 1 | bEnableObstacleAvoidance | ||
| uint8: 1 | bEnableOptimizeTopology | ||
| uint8: 1 | bEnableOptimizeVisibility | ||
| uint8: 1 | bEnablePathOffset | ||
| uint8: 1 | bEnableSeparation | ||
| uint8: 1 | bEnableSimulationReplanOnResume | ||
| uint8: 1 | bEnableSlowdownAtGoal | ||
| uint8: 1 | bFinalPathPart | If set, agent if moving on final path part, skip further updates (runtime flag) | |
| uint8: 1 | bRegisteredWithCrowdSimulation | Set when agent is registered in crowd simulation (either controlled or an obstacle) | |
| uint8: 1 | bRotateToVelocity | If set, move focus will match velocity direction | |
| uint8: 1 | bSuspendCrowdSimulation | If set, avoidance and steering will be suspended (used for direct move requests) | |
| const FVector bool | bTraversingLink | ||
| uint8: 1 | bUpdateDirectMoveVelocity | If set, move velocity will be updated in every tick | |
| float | CollisionQueryRange | ||
| FVector | CrowdAgentMoveDirection | ||
| const FVector & | DestPathCorner | ||
| int32 | LastPathPolyIndex | Last visited poly on path | |
| float | PathOptimizationRange | ||
| int32 | PathStartIndex | Start index of current path part | |
| float | SeparationWeight | ||
| ECrowdSimulationState | SimulationState | ||
| friend | UCrowdManager |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UCrowdFollowingComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ApplyCrowdAgentPosition
(
const FVector& NewPosition |
Pass desired position to movement component (after resolving collisions between crowd agents) | |
| void | ApplyCrowdAgentVelocity
(
const FVector& NewVelocity, |
Pass agent velocity to movement component | |
| void | BeginDestroy () |
||
| int32 | |||
| ECrowdAvoidanceQuality::Type | |||
| float | |||
| float | |||
| float | |||
| float | |||
| ECrowdSimulationState | |||
| int32 | |||
| int32 | |||
| bool | |||
| bool | |||
| bool | Checks if bEnableAnticipateTurns is set to true, and if crowd simulation is not suspended | ||
| bool | |||
| bool | Checks if bEnableObstacleAvoidance is set to true, and if crowd simulation is not suspended | ||
| bool | |||
| bool | Checks if bEnableOptimizeTopology is set to true, and if crowd simulation is not suspended | ||
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | Checks if bEnableSeparation is set to true, and if crowd simulation is not suspended | ||
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| void | OnNavNodeChanged
(
NavNodeRef NewPolyRef, |
Called when agent moved to next nav node (poly) | |
| void | |||
| void | SetAvoidanceGroup
(
int32 GroupFlags, |
||
| void | SetCrowdAffectFallingVelocity
(
bool bEnable |
||
| void | SetCrowdAnticipateTurns
(
bool bEnable, |
||
| void | SetCrowdAvoidanceQuality
(
ECrowdAvoidanceQuality::Type Quality, |
||
| void | SetCrowdAvoidanceRangeMultiplier
(
float Multiplier, |
||
| void | SetCrowdCollisionQueryRange
(
float Range, |
||
| void | SetCrowdObstacleAvoidance
(
bool bEnable, |
||
| void | SetCrowdOptimizeTopology
(
bool bEnable, |
||
| void | SetCrowdOptimizeVisibility
(
bool bEnable, |
||
| void | SetCrowdPathOffset
(
bool bEnable, |
||
| void | SetCrowdPathOptimizationRange
(
float Range, |
||
| void | SetCrowdRotateToVelocity
(
bool bEnable |
||
| void | SetCrowdSeparation
(
bool bEnable, |
||
| void | SetCrowdSeparationWeight
(
float Weight, |
||
| void | SetCrowdSimulationState
(
ECrowdSimulationState NewState |
Switch between crowd simulation and parent implementation (following path segments) | |
| void | SetCrowdSlowdownAtGoal
(
bool bEnable, |
||
| void | SetGroupsToAvoid
(
int32 GroupFlags, |
||
| void | SetGroupsToIgnore
(
int32 GroupFlags, |
||
| bool | ShouldSwitchPathPart
(
int32 CorridorSize |
||
| bool | ShouldTrackMovingGoal
(
FVector& OutGoalLocation |
||
| void | SuspendCrowdSteering
(
bool bSuspend |
Main switch for crowd steering & avoidance | |
| void | |||
|
|||
| void | UpdateCachedDirections
(
const FVector& NewVelocity, |
||
| void | Update params in crowd manager |
Overridden from UPathFollowingComponent
| Type | Name | Description | |
|---|---|---|---|
| void | AbortMove
(
const UObject& Instigator, |
Aborts following path | |
| void | Cleanup () |
Cleanup component before destroying | |
| void | DescribeSelfToVisLog
(
FVisualLogEntry* Snapshot |
||
| int32 | DetermineStartingPathPoint
(
const FNavigationPath* ConsideredPath |
PathFollowingComponent BEGIN. | |
| void | FinishUsingCustomLink
(
INavLinkCustomInterface* CustomNavLink |
Call when moving agent finishes using custom nav link, returns control back to path following | |
| void | FollowPathSegment
(
float DeltaTime |
Follow current path segment | |
| int32 | Returns index of the currently followed element of path. | ||
| void | GetDebugStringTokens
(
TArray< FString >& Tokens, |
||
| FVector | GetMoveFocus
(
bool bAllowStrafe |
Get current focal point of movement | |
| void | Initialize () |
PathFollowingComponent BEGIN. | |
| bool | IsOnPath () |
Check if agent is on path | |
| void | OnLanded () |
||
| void | Called when NavigationSystem finishes initial navigation data registration. | ||
| void | OnPathfindingQuery
(
FPathFindingQuery& Query |
Called when owner is preparing new pathfinding request | |
| void | OnPathFinished
(
const FPathFollowingResult& Result |
Notify about finished movement | |
| void | Notify about changing current path: new pointer or update from path event | ||
| void | PauseMove
(
FAIRequestID RequestID, |
Pause path following | |
| void | Reset () |
Reset path following data | |
| void | ResumeMove
(
FAIRequestID RequestID |
Resume path following | |
| void | SetMoveSegment
(
int32 SegmentStartIndex |
Sets variables related to current move segment | |
| bool | Should verify if agent if still on path ater movement has been resumed? | ||
| bool | UpdateMovementComponent
(
bool bForce |
Check if movement component is valid or tries to grab one from owner | |
| void | Check state of path following, update move segment if needed |
Overridden from ICrowdAgentInterface
| Type | Name | Description | |
|---|---|---|---|
| int32 | Group mask for this agent | ||
| void | GetCrowdAgentCollisions
(
float& CylinderRadius, |
Fills information about agent's collision cylinder | |
| int32 | Will avoid other agents if they are in one of specified groups | ||
| int32 | Will NOT avoid other agents if they are in one of specified groups, higher priority than GroupsToAvoid | ||
| FVector | |||
| float | |||
| FVector |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| FNavAvoidanceMask | AvoidanceGroup_DEPRECATED | DEPRECATED: Group mask for this agent - use IRVOAvoidanceInterface instead | |
| FNavAvoidanceMask | GroupsToAvoid_DEPRECATED | DEPRECATED: Will avoid other agents if they are in one of specified groups - use IRVOAvoidanceInterface instead | |
| FNavAvoidanceMask | GroupsToIgnore_DEPRECATED | DEPRECATED: Will NOT avoid other agents if they are in one of specified groups, higher priority than GroupsToAvoid - use IRVOAvoidanceInterface instead |