CARLA
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AWalkerController Class Reference

Possesses every walker pawn. More...

#include <WalkerController.h>

+ Inheritance diagram for AWalkerController:

Public Member Functions

void ApplyWalkerControl (const FWalkerControl &InControl)
 
 AWalkerController (const FObjectInitializer &ObjectInitializer)
 
void BlendPose (float Blend)
 
void GetBonesTransform (FWalkerBoneControlOut &WalkerBones)
 
float GetMaximumWalkSpeed () const
 Maximum walk speed allowed in centimetres per second.
 
void GetPoseFromAnimation ()
 
const FWalkerControl GetWalkerControl () const
 
bool GoToNavLocation (const FVector &WorldLocation)
 Path-follow to WorldLocation (world-local centimeters) on the navmesh through the crowd following component.
 
bool IsNavigationActive () const
 
void OnPossess (APawn *InPawn) override
 
void SetBonesTransform (const FWalkerBoneControlIn &WalkerBones)
 
bool SetNavMaxSpeed (float SpeedCmPerSec)
 Walking speed used while navigating, in cm/s.
 
bool StartNavigation (bool bIsCrosser=false)
 – Server-side navmesh navigation ------------------------------------—
 
bool StopNavigation ()
 Abort any navigation request and return to manual control.
 
void Tick (float DeltaSeconds) override
 

Private Member Functions

void SetNavigationActive (bool bActive)
 

Private Attributes

bool bNavCrosser = false
 Whether this walker may traverse road/crosswalk nav areas.
 
bool bNavigationActive = false
 
FWalkerControl Control
 
float NavMaxSpeed = 139.0f
 Walking speed applied while navigating, cm/s (defaults to the usual pedestrian speed the Python clients use, 1.39 m/s).
 

Detailed Description

Possesses every walker pawn.

Historically a plain AController that only relayed the client-computed FWalkerControl into the character movement; it is now an AAIController with a UCrowdFollowingComponent so the server can also path-follow on the engine navmesh (server-side pedestrian navigation on World Partition maps). Manual FWalkerControl input and navmesh following are mutually exclusive: applying a manual control aborts any active navigation request.

Definition at line 32 of file WalkerController.h.

Constructor & Destructor Documentation

◆ AWalkerController()

AWalkerController::AWalkerController ( const FObjectInitializer &  ObjectInitializer)

Definition at line 23 of file WalkerController.cpp.

Member Function Documentation

◆ ApplyWalkerControl()

void AWalkerController::ApplyWalkerControl ( const FWalkerControl &  InControl)

Definition at line 54 of file WalkerController.cpp.

References bNavigationActive, Control, and StopNavigation().

◆ BlendPose()

void AWalkerController::BlendPose ( float  Blend)

Definition at line 240 of file WalkerController.cpp.

References UWalkerAnim::Blend.

Referenced by CarlaReplayerHelper::ProcessReplayerWalkerBones().

◆ GetBonesTransform()

void AWalkerController::GetBonesTransform ( FWalkerBoneControlOut &  WalkerBones)

◆ GetMaximumWalkSpeed()

float AWalkerController::GetMaximumWalkSpeed ( ) const
inline

Maximum walk speed allowed in centimetres per second.

Definition at line 46 of file WalkerController.h.

Referenced by OnPossess(), SetNavigationActive(), SetNavMaxSpeed(), and Tick().

◆ GetPoseFromAnimation()

void AWalkerController::GetPoseFromAnimation ( )

Definition at line 260 of file WalkerController.cpp.

References UWalkerAnim::Snap.

◆ GetWalkerControl()

const FWalkerControl AWalkerController::GetWalkerControl ( ) const
inline

Definition at line 55 of file WalkerController.h.

◆ GoToNavLocation()

bool AWalkerController::GoToNavLocation ( const FVector &  WorldLocation)

Path-follow to WorldLocation (world-local centimeters) on the navmesh through the crowd following component.

Implies StartNavigation().

Definition at line 81 of file WalkerController.cpp.

References bNavCrosser, and StartNavigation().

◆ IsNavigationActive()

bool AWalkerController::IsNavigationActive ( ) const
inline

Definition at line 95 of file WalkerController.h.

◆ OnPossess()

void AWalkerController::OnPossess ( APawn *  InPawn)
override

Definition at line 32 of file WalkerController.cpp.

References GetMaximumWalkSpeed().

◆ SetBonesTransform()

void AWalkerController::SetBonesTransform ( const FWalkerBoneControlIn &  WalkerBones)

◆ SetNavigationActive()

void AWalkerController::SetNavigationActive ( bool  bActive)
private

Definition at line 137 of file WalkerController.cpp.

References bNavigationActive, Control, GetMaximumWalkSpeed(), and NavMaxSpeed.

Referenced by StartNavigation(), and StopNavigation().

◆ SetNavMaxSpeed()

bool AWalkerController::SetNavMaxSpeed ( float  SpeedCmPerSec)

Walking speed used while navigating, in cm/s.

The manual control path scales its input against GetMaximumWalkSpeed(), so the character's MaxWalkSpeed is only lowered to this value while navigation is active and restored when it stops.

Definition at line 109 of file WalkerController.cpp.

References bNavigationActive, GetMaximumWalkSpeed(), and NavMaxSpeed.

◆ StartNavigation()

bool AWalkerController::StartNavigation ( bool  bIsCrosser = false)

– Server-side navmesh navigation ------------------------------------—

Enter navigation mode (idempotent). Returns false if no walker pawn is possessed. The manual control input is suppressed while navigating. bIsCrosser selects the query filter: crossers may traverse road/crosswalk nav areas (drawn once per walker by the episode with probability pedestrians_cross_factor); the flag is ignored when navigation is already active, so repeated Start calls cannot re-draw.

Definition at line 66 of file WalkerController.cpp.

References bNavCrosser, bNavigationActive, and SetNavigationActive().

Referenced by GoToNavLocation().

◆ StopNavigation()

bool AWalkerController::StopNavigation ( )

Abort any navigation request and return to manual control.

Definition at line 127 of file WalkerController.cpp.

References bNavigationActive, and SetNavigationActive().

Referenced by ApplyWalkerControl().

◆ Tick()

void AWalkerController::Tick ( float  DeltaSeconds)
override

Member Data Documentation

◆ bNavCrosser

bool AWalkerController::bNavCrosser = false
private

Whether this walker may traverse road/crosswalk nav areas.

Drawn once per walker when its navigation starts.

Definition at line 114 of file WalkerController.h.

Referenced by GoToNavLocation(), and StartNavigation().

◆ bNavigationActive

bool AWalkerController::bNavigationActive = false
private

◆ Control

FWalkerControl AWalkerController::Control
private

Definition at line 104 of file WalkerController.h.

Referenced by ApplyWalkerControl(), SetNavigationActive(), and Tick().

◆ NavMaxSpeed

float AWalkerController::NavMaxSpeed = 139.0f
private

Walking speed applied while navigating, cm/s (defaults to the usual pedestrian speed the Python clients use, 1.39 m/s).

Definition at line 108 of file WalkerController.h.

Referenced by SetNavigationActive(), and SetNavMaxSpeed().


The documentation for this class was generated from the following files: