UAvoidanceManager

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/AI/Navigation/AvoidanceManager.h

Include

#include "AI/Navigation/AvoidanceManager.h"

Syntax

class UAvoidanceManager :
    public UObject ,
    public FSelfRegisteringExec

Variables

Name Description

Protected variable

TArray < FVeloci ...

 

AllCones

Keeping this here to avoid constant allocation

Public variable

float

 

ArtificialRadiusExpansion

Multiply the radius of all STORED avoidance objects by this value to allow a little extra room for avoidance maneuvers.

Protected variable

TMap < int32 , FN ...

 

AvoidanceObjects

All objects currently part of the avoidance solution. This is pretty transient stuff.

Protected variable

uint32 : 1

 

bAutoPurceOutdatedObjects

If set then UAvoidanceManager::RemoveOutdatedObjects is responsisble for removing dead entries in AvoidanceObjects.

Protected variable

bool

 

bDebugAll

Protected variable

uint32 : 1

 

bRequestedUpdateTimer

Set when RemoveOutdatedObjects timer is already requested

Protected variable

TArray < int32 >

 

DebugUIDs

Print out debug information when we predict using any of these IDs as our IgnoreUID

Public variable

float

 

DefaultTimeToLive

How long an avoidance UID must not be updated before the system will put it back in the pool.

Public variable

float

 

DeltaTimeToPredict

This is how far forward in time (seconds) we extend our velocity cones and thus our prediction

Protected variable

INavEdgeProvide ...

 

EdgeProviderInterface

Protected variable

TWeakObjectPtr <...

 

EdgeProviderOb

Provider of navigation edges to consider for avoidance

Public variable

float

 

HeightCheckMargin

Allowable height margin between obstacles and agents.

Public variable

float

 

LockTimeAfterAvoid

How long to stay on course (barring collision) after making an avoidance move

Public variable

float

 

LockTimeAfterClean

How long to stay on course (barring collision) after making an unobstructed move (should be > 0.0, but can be less than a full frame)

Protected variable

TArray < int32 >

 

NewKeyPool

This is a pool of keys to be used when new objects are created.

Protected variable

FTimerHandle

 

TimerHandle_RemoveOutdatedObjects

Handle for efficient management of RemoveOutdatedObjects timer

Constructors

Name Description

Public function

UAvoidanceManager

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

void

 

AvoidanceDebugForAll

(
    bool TurnOn
)

Public function

void

 

AvoidanceDebugForUID

(
    int32 AvoidanceUID,
    bool TurnOn
)

Public function Static

void

 

AvoidanceSystemToggle

(
    bool TurnOn
)

Public function Const

const FNavAv ...

 

GetAvoidanceObjectForUID

(
    int32 AvoidanceUID
)

Public function

FNavAvoidanc ...

 

GetAvoidanceObjectForUID

(
    int32 AvoidanceUID
)

Get your latest data.

Public function

FVector

 

GetAvoidanceVelocity

(
    const FNavAvoidanceData & Avoidance...,
    float DeltaTime
)

Only use if you want manual velocity planning.

Protected function

FVector

 

GetAvoidanceVelocity_Internal

(
    const FNavAvoidanceData & Avoidance...,
    float DeltaTime,
    int32 * IgnoreThisUID
)

This is called by our blueprint-accessible functions, and permits the user to ignore self, or not.

Public function

FVector

 

GetAvoidanceVelocityForComponent

(
    UCharacterMovementComponent * M...
)

Fast-track GetAvoidanceVelocityForComponent(UMovementComponent) implementation for most common case of UCharacterMovementComponent

Public function

FVector

 

GetAvoidanceVelocityForComponent

(
    UMovementComponent * MovementCo...
)

Calculate avoidance velocity for component (avoids collisions with the supplied component)

Public function

FVector

 

GetAvoidanceVelocityIgnoringUID

(
    const FNavAvoidanceData & Avoidance...,
    float DeltaTime,
    int32 IgnoreThisUID
)

Only use if you want manual velocity planning.

Public function

int32

 

GetNewAvoidanceUID()

Get appropriate UID for use when reporting to this function or requesting RVO assistance.

Public function

int32

 

GetObjectCount()

Get the number of avoidance objects currently in the manager.

Public function

void

 

HandleToggleAvoidance

(
    const TCHAR * Cmd,
    FOutputDevice & Ar
)

Public function

void

 

HandleToggleDebugAll

(
    const TCHAR * Cmd,
    FOutputDevice & Ar
)

Exec command handlers

Public function

bool

 

IsDebugEnabled

(
    int32 AvoidanceUID
)

Public function

bool

 

IsDebugOnForAll()

Public function

bool

 

IsDebugOnForUID

(
    int32 AvoidanceUID
)

Public function

void

 

OverrideToMaxWeight

(
    int32 AvoidanceUID,
    float Duration
)

For Duration seconds, set this object to ignore all others.

Public function

bool

 

RegisterMovementComponent

(
    UMovementComponent * MovementCo...,
    float AvoidanceWeight
)

Register with the given avoidance manager.

Public function

bool

 

RegisterMovementComponent

(
    UCharacterMovementComponent * M...,
    float AvoidanceWeight
)

Public function

void

 

RemoveAvoidanceObject

(
    const int32 AvoidanceUID
)

Used to manually mark data associated with given ID as 'dead' (and reusable)

Protected function

void

 

RemoveOutdatedObjects()

Cleanup AvoidanceObjects, called by timer

Protected function

void

 

RequestUpdateTimer()

Try to set a timer for RemoveOutdatedObjects

Public function

void

 

SetNavEdgeProvider

(
    INavEdgeProviderInterface * InE...
)

Public function

void

 

UpdateRVO

(
    UMovementComponent * MovementCo...
)

Update the RVO avoidance data for the participating UMovementComponent

Public function

void

 

UpdateRVO

(
    UCharacterMovementComponent * M...
)

Fast-track UpdateRVO(UMovementComponent) implementation for most common case of UCharacterMovementComponent

Protected function

void

 

UpdateRVO_Internal

(
    int32 AvoidanceUID,
    const FNavAvoidanceData & Avoidance...
)

This is called by our blueprint-accessible function after it has packed the data into an object.

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

(
    UWorld * InWorld,
    const TCHAR * Cmd,
    FOutputDevice & Ar
)

Exec handler

Constants

Name

Description

bSystemActive

Master switch for avoidance system

Deprecated Variables

Name Description

Public variable

float

 

TestHeightDifference_DEPRECATED

Deprecated - use HeightCheckMargin, generally a much smaller value.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback