CARLA
List of all members
ACarlaWheeledVehicle Class Reference

Base class for CARLA wheeled vehicles. More...

#include <CarlaWheeledVehicle.h>

+ Inheritance diagram for ACarlaWheeledVehicle:
+ Collaboration diagram for ACarlaWheeledVehicle:

Public Member Functions

Constructor and destructor
 ACarlaWheeledVehicle (const FObjectInitializer &ObjectInitializer)
 
 ~ACarlaWheeledVehicle ()
 
Get functions
const FVehicleControlGetVehicleControl () const
 Vehicle control currently applied to this vehicle. More...
 
const FVehicleAckermannControlGetVehicleAckermannControl () const
 Vehicle Ackermann control currently applied to this vehicle. More...
 
FTransform GetVehicleTransform () const
 Transform of the vehicle. More...
 
float GetVehicleForwardSpeed () const
 Forward speed in cm/s. Might be negative if goes backwards. More...
 
FVector GetVehicleOrientation () const
 Orientation vector of the vehicle, pointing forward. More...
 
int32 GetVehicleCurrentGear () const
 Active gear of the vehicle. More...
 
FTransform GetVehicleBoundingBoxTransform () const
 Transform of the vehicle's bounding box relative to the vehicle. More...
 
FVector GetVehicleBoundingBoxExtent () const
 Extent of the vehicle's bounding box. More...
 
UBoxComponent * GetVehicleBoundingBox () const
 Get vehicle's bounding box component. More...
 
float GetMaximumSteerAngle () const
 Get the maximum angle at which the front wheel can steer. More...
 
AI debug state
void SetAIVehicleState (ECarlaWheeledVehicleState InState)
 
ECarlaWheeledVehicleState GetAIVehicleState () const
 
FVehiclePhysicsControl GetVehiclePhysicsControl () const
 
FAckermannControllerSettings GetAckermannControllerSettings () const
 
void RestoreVehiclePhysicsControl ()
 
FVehicleLightState GetVehicleLightState () const
 
void ApplyVehiclePhysicsControl (const FVehiclePhysicsControl &PhysicsControl)
 
void ApplyAckermannControllerSettings (const FAckermannControllerSettings &AckermannControllerSettings)
 
void SetSimulatePhysics (bool enabled)
 
void SetWheelCollision (UWheeledVehicleMovementComponent4W *Vehicle4W, const FVehiclePhysicsControl &PhysicsControl)
 
void SetWheelCollisionNW (UWheeledVehicleMovementComponentNW *VehicleNW, const FVehiclePhysicsControl &PhysicsControl)
 
void SetVehicleLightState (const FVehicleLightState &LightState)
 
void SetFailureState (const carla::rpc::VehicleFailureState &FailureState)
 
bool IsTwoWheeledVehicle ()
 
virtual bool IsTwoWheeledVehicle_Implementation ()
 
Vehicle input control
void ApplyVehicleControl (const FVehicleControl &Control, EVehicleInputPriority Priority)
 
void ApplyVehicleAckermannControl (const FVehicleAckermannControl &AckermannControl, EVehicleInputPriority Priority)
 
bool IsAckermannControlActive () const
 
void ActivateVelocityControl (const FVector &Velocity)
 
void DeactivateVelocityControl ()
 
void ShowDebugTelemetry (bool Enabled)
 
void FlushVehicleControl ()
 
DEPRECATED Set functions
void SetThrottleInput (float Value)
 
void SetSteeringInput (float Value)
 
void SetBrakeInput (float Value)
 
void SetReverse (bool Value)
 
void ToggleReverse ()
 
void SetHandbrakeInput (bool Value)
 
void HoldHandbrake ()
 
void ReleaseHandbrake ()
 
TArray< float > GetWheelsFrictionScale ()
 
void SetWheelsFrictionScale (TArray< float > &WheelsFrictionScale)
 
void SetCarlaMovementComponent (UBaseCarlaMovementComponent *MoementComponent)
 
template<typename T = UBaseCarlaMovementComponent>
T * GetCarlaMovementComponent () const
 

Overriden from AActor

TArray< FName > ConstraintComponentNames
 
float DoorOpenStrength = 100.0f
 
ECarlaWheeledVehicleState State = ECarlaWheeledVehicleState::UNKNOWN
 Current state of the vehicle controller (for debugging purposes). More...
 
UVehicleVelocityControl * VelocityControl
 
struct {
   FVehicleControl   Control
 
   FVehicleLightState   LightState
 
   EVehicleInputPriority   Priority = EVehicleInputPriority::INVALID
 
InputControl
 
FVehicleControl LastAppliedControl
 
FVehicleAckermannControl LastAppliedAckermannControl
 
FVehiclePhysicsControl LastPhysicsControl
 
bool bAckermannControlActive = false
 
FAckermannController AckermannController
 
float RolloverBehaviorForce = 0.35
 
int RolloverBehaviorTracker = 0
 
float RolloverFlagTime = 5.0f
 
carla::rpc::VehicleFailureState FailureState = carla::rpc::VehicleFailureState::None
 
bool bPhysicsEnabled = true
 
UBaseCarlaMovementComponentBaseMovementComponent = nullptr
 
TArray< UPhysicsConstraintComponent * > ConstraintsComponents
 
TMap< UPhysicsConstraintComponent *, UPrimitiveComponent * > ConstraintDoor
 
TMap< UPrimitiveComponent *, FTransform > DoorComponentsTransform
 
TMap< UPrimitiveComponent *, UPhysicsConstraintComponent * > CollisionDisableConstraints
 
FTimerHandle TimerHandler
 
float DetectionSize { 750.0f }
 
FBox FoliageBoundingBox
 
UBoxComponent * VehicleBounds
 
float CarSimOriginOffset = 150.f
 
bool bIsNWVehicle = false
 
float SpeedAnim { 0.0f }
 
float RotationAnim { 0.0f }
 
FBox GetDetectionBox () const
 
float GetDetectionSize () const
 
void UpdateDetectionBox ()
 
const TArray< int32 > GetFoliageInstancesCloseToVehicle (const UInstancedStaticMeshComponent *Component) const
 
void DrawFoliageBoundingBox () const
 
FBoxSphereBounds GetBoxSphereBounds () const
 
bool IsInVehicleRange (const FVector &Location) const
 
void SetWheelSteerDirection (EVehicleWheelLocation WheelLocation, float AngleInDeg)
 Set the rotation of the car wheels indicated by the user 0 = FL_VehicleWheel, 1 = FR_VehicleWheel, 2 = BL_VehicleWheel, 3 = BR_VehicleWheel NOTE : This is purely aesthetic. More...
 
float GetWheelSteerAngle (EVehicleWheelLocation WheelLocation)
 
void OpenDoor (const EVehicleDoor DoorIdx)
 
void CloseDoor (const EVehicleDoor DoorIdx)
 
void OpenDoorPhys (const EVehicleDoor DoorIdx)
 
void CloseDoorPhys (const EVehicleDoor DoorIdx)
 
virtual FVector GetVelocity () const override
 
void SetRolloverFlag ()
 
carla::rpc::VehicleFailureState GetFailureState () const
 
float GetSpeedAnim () const
 
void SetSpeedAnim (float Speed)
 
float GetRotationAnim () const
 
void SetRotationAnim (float Rotation)
 
virtual void BeginPlay () override
 
virtual void EndPlay (const EEndPlayReason::Type EndPlayReason)
 
void RefreshLightState (const FVehicleLightState &VehicleLightState)
 
void AdjustVehicleBounds ()
 
void ResetConstraints ()
 
static FRotator GetPhysicsConstraintAngle (UPhysicsConstraintComponent *Component)
 
static void SetPhysicsConstraintAngle (UPhysicsConstraintComponent *Component, const FRotator &NewAngle)
 
void ApplyRolloverBehavior ()
 Rollovers tend to have too much angular velocity, resulting in the vehicle doing a full 360ยบ flip. More...
 
void CheckRollover (const float roll, const std::pair< float, float > threshold_roll)
 
void AddReferenceToManager ()
 
void RemoveReferenceToManager ()
 

Detailed Description

Base class for CARLA wheeled vehicles.

Definition at line 72 of file CarlaWheeledVehicle.h.

Constructor & Destructor Documentation

◆ ACarlaWheeledVehicle()

ACarlaWheeledVehicle::ACarlaWheeledVehicle ( const FObjectInitializer &  ObjectInitializer)

Definition at line 35 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent, VehicleBounds, and VelocityControl.

◆ ~ACarlaWheeledVehicle()

ACarlaWheeledVehicle::~ACarlaWheeledVehicle ( )

Definition at line 50 of file CarlaWheeledVehicle.cpp.

Member Function Documentation

◆ ActivateVelocityControl()

void ACarlaWheeledVehicle::ActivateVelocityControl ( const FVector &  Velocity)

Definition at line 793 of file CarlaWheeledVehicle.cpp.

References VelocityControl.

◆ AddReferenceToManager()

void ACarlaWheeledVehicle::AddReferenceToManager ( )
private

Definition at line 1084 of file CarlaWheeledVehicle.cpp.

References AVegetationManager::AddVehicle(), and IsValid().

Referenced by BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AdjustVehicleBounds()

void ACarlaWheeledVehicle::AdjustVehicleBounds ( )
protected

Definition at line 257 of file CarlaWheeledVehicle.cpp.

References BoundingBox, FBoundingBox::Extent, UBoundingBoxCalculator::GetVehicleBoundingBox(), FBoundingBox::Origin, and VehicleBounds.

+ Here is the call graph for this function:

◆ ApplyAckermannControllerSettings()

void ACarlaWheeledVehicle::ApplyAckermannControllerSettings ( const FAckermannControllerSettings AckermannControllerSettings)
inline

Definition at line 181 of file CarlaWheeledVehicle.h.

Referenced by FVehicleData::RestoreActorData().

+ Here is the caller graph for this function:

◆ ApplyRolloverBehavior()

void ACarlaWheeledVehicle::ApplyRolloverBehavior ( )
private

Rollovers tend to have too much angular velocity, resulting in the vehicle doing a full 360ยบ flip.

This function progressively reduces the vehicle's angular velocity so that it ends up upside down instead.

Definition at line 1037 of file CarlaWheeledVehicle.cpp.

References CheckRollover(), FailureState, GetVehicleTransform(), carla::rpc::None, RolloverBehaviorTracker, RolloverFlagTime, SetRolloverFlag(), and TimerHandler.

+ Here is the call graph for this function:

◆ ApplyVehicleAckermannControl()

void ACarlaWheeledVehicle::ApplyVehicleAckermannControl ( const FVehicleAckermannControl AckermannControl,
EVehicleInputPriority  Priority 
)
inline

Definition at line 225 of file CarlaWheeledVehicle.h.

Referenced by FVehicleData::RestoreActorData().

+ Here is the caller graph for this function:

◆ ApplyVehicleControl()

void ACarlaWheeledVehicle::ApplyVehicleControl ( const FVehicleControl Control,
EVehicleInputPriority  Priority 
)
inline

Definition at line 210 of file CarlaWheeledVehicle.h.

Referenced by ActorROS2Handler::operator()(), FVehicleData::RestoreActorData(), SetBrakeInput(), SetHandbrakeInput(), SetReverse(), SetSteeringInput(), SetThrottleInput(), and AWheeledVehicleAIController::Tick().

+ Here is the caller graph for this function:

◆ ApplyVehiclePhysicsControl()

void ACarlaWheeledVehicle::ApplyVehiclePhysicsControl ( const FVehiclePhysicsControl PhysicsControl)

◆ BeginPlay()

void ACarlaWheeledVehicle::BeginPlay ( )
overrideprotectedvirtual

◆ CheckRollover()

void ACarlaWheeledVehicle::CheckRollover ( const float  roll,
const std::pair< float, float >  threshold_roll 
)
private

Definition at line 1064 of file CarlaWheeledVehicle.cpp.

References RolloverBehaviorForce, and RolloverBehaviorTracker.

Referenced by ApplyRolloverBehavior().

+ Here is the caller graph for this function:

◆ CloseDoor()

void ACarlaWheeledVehicle::CloseDoor ( const EVehicleDoor  DoorIdx)

Definition at line 976 of file CarlaWheeledVehicle.cpp.

References All, CloseDoorPhys(), and ConstraintsComponents.

+ Here is the call graph for this function:

◆ CloseDoorPhys()

void ACarlaWheeledVehicle::CloseDoorPhys ( const EVehicleDoor  DoorIdx)

Definition at line 1024 of file CarlaWheeledVehicle.cpp.

References ConstraintDoor, ConstraintsComponents, and DoorComponentsTransform.

Referenced by CloseDoor(), and ResetConstraints().

+ Here is the caller graph for this function:

◆ DeactivateVelocityControl()

void ACarlaWheeledVehicle::DeactivateVelocityControl ( )

Definition at line 798 of file CarlaWheeledVehicle.cpp.

References VelocityControl.

◆ DrawFoliageBoundingBox()

void ACarlaWheeledVehicle::DrawFoliageBoundingBox ( ) const

Definition at line 238 of file CarlaWheeledVehicle.cpp.

References FoliageBoundingBox.

◆ EndPlay()

void ACarlaWheeledVehicle::EndPlay ( const EEndPlayReason::Type  EndPlayReason)
protectedvirtual

Definition at line 952 of file CarlaWheeledVehicle.cpp.

References RemoveReferenceToManager(), and ShowDebugTelemetry().

+ Here is the call graph for this function:

◆ FlushVehicleControl()

void ACarlaWheeledVehicle::FlushVehicleControl ( )
Todo:
This function should be private to AWheeledVehicleAIController.

Definition at line 320 of file CarlaWheeledVehicle.cpp.

References AckermannController, bAckermannControlActive, BaseMovementComponent, InputControl, INVALID, LastAppliedControl, UBaseCarlaMovementComponent::ProcessControl(), FAckermannController::RunLoop(), and FAckermannController::UpdateVehicleState().

Referenced by AWheeledVehicleAIController::Tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAckermannControllerSettings()

FAckermannControllerSettings ACarlaWheeledVehicle::GetAckermannControllerSettings ( ) const
inline

Definition at line 169 of file CarlaWheeledVehicle.h.

References PhysicsControl.

Referenced by FVehicleData::RecordActorData().

+ Here is the caller graph for this function:

◆ GetAIVehicleState()

ECarlaWheeledVehicleState ACarlaWheeledVehicle::GetAIVehicleState ( ) const
inline

Definition at line 160 of file CarlaWheeledVehicle.h.

References State.

◆ GetBoxSphereBounds()

FBoxSphereBounds ACarlaWheeledVehicle::GetBoxSphereBounds ( ) const

Definition at line 246 of file CarlaWheeledVehicle.cpp.

References UCarlaStatics::GetLargeMapManager(), ALargeMapManager::LocalToGlobalTransform(), and VehicleBounds.

+ Here is the call graph for this function:

◆ GetCarlaMovementComponent()

template<typename T = UBaseCarlaMovementComponent>
T* ACarlaWheeledVehicle::GetCarlaMovementComponent ( ) const
inline

Definition at line 296 of file CarlaWheeledVehicle.h.

◆ GetDetectionBox()

FBox ACarlaWheeledVehicle::GetDetectionBox ( ) const

Definition at line 227 of file CarlaWheeledVehicle.cpp.

References FoliageBoundingBox.

◆ GetDetectionSize()

float ACarlaWheeledVehicle::GetDetectionSize ( ) const

Definition at line 233 of file CarlaWheeledVehicle.cpp.

References DetectionSize.

◆ GetFailureState()

carla::rpc::VehicleFailureState ACarlaWheeledVehicle::GetFailureState ( ) const

Definition at line 1080 of file CarlaWheeledVehicle.cpp.

References FailureState.

Referenced by FVehicleData::RecordActorData().

+ Here is the caller graph for this function:

◆ GetFoliageInstancesCloseToVehicle()

const TArray< int32 > ACarlaWheeledVehicle::GetFoliageInstancesCloseToVehicle ( const UInstancedStaticMeshComponent *  Component) const

Definition at line 221 of file CarlaWheeledVehicle.cpp.

References FoliageBoundingBox.

◆ GetMaximumSteerAngle()

float ACarlaWheeledVehicle::GetMaximumSteerAngle ( ) const

Get the maximum angle at which the front wheel can steer.

Definition at line 307 of file CarlaWheeledVehicle.cpp.

Referenced by AWheeledVehicleAIController::OnPossess(), and FAckermannController::UpdateVehiclePhysics().

+ Here is the caller graph for this function:

◆ GetPhysicsConstraintAngle()

FRotator ACarlaWheeledVehicle::GetPhysicsConstraintAngle ( UPhysicsConstraintComponent *  Component)
static

Definition at line 1114 of file CarlaWheeledVehicle.cpp.

◆ GetRotationAnim()

float ACarlaWheeledVehicle::GetRotationAnim ( ) const
inline

Definition at line 474 of file CarlaWheeledVehicle.h.

◆ GetSpeedAnim()

float ACarlaWheeledVehicle::GetSpeedAnim ( ) const
inline

Definition at line 468 of file CarlaWheeledVehicle.h.

◆ GetVehicleAckermannControl()

const FVehicleAckermannControl& ACarlaWheeledVehicle::GetVehicleAckermannControl ( ) const
inline

Vehicle Ackermann control currently applied to this vehicle.

Definition at line 102 of file CarlaWheeledVehicle.h.

Referenced by FVehicleData::RecordActorData().

+ Here is the caller graph for this function:

◆ GetVehicleBoundingBox()

UBoxComponent* ACarlaWheeledVehicle::GetVehicleBoundingBox ( ) const
inline

Get vehicle's bounding box component.

Definition at line 137 of file CarlaWheeledVehicle.h.

◆ GetVehicleBoundingBoxExtent()

FVector ACarlaWheeledVehicle::GetVehicleBoundingBoxExtent ( ) const

Extent of the vehicle's bounding box.

Definition at line 302 of file CarlaWheeledVehicle.cpp.

References VehicleBounds.

Referenced by IsThereAnObstacleAhead().

+ Here is the caller graph for this function:

◆ GetVehicleBoundingBoxTransform()

FTransform ACarlaWheeledVehicle::GetVehicleBoundingBoxTransform ( ) const

Transform of the vehicle's bounding box relative to the vehicle.

Definition at line 297 of file CarlaWheeledVehicle.cpp.

References VehicleBounds.

◆ GetVehicleControl()

const FVehicleControl& ACarlaWheeledVehicle::GetVehicleControl ( ) const
inline

Vehicle control currently applied to this vehicle.

Definition at line 95 of file CarlaWheeledVehicle.h.

Referenced by UDefaultMovementComponent::ProcessControl(), FVehicleData::RecordActorData(), FSparseHighDetailMap::SaveMap(), and FAckermannController::UpdateVehicleState().

+ Here is the caller graph for this function:

◆ GetVehicleCurrentGear()

int32 ACarlaWheeledVehicle::GetVehicleCurrentGear ( ) const

Active gear of the vehicle.

Definition at line 292 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent, and UBaseCarlaMovementComponent::GetVehicleCurrentGear().

+ Here is the call graph for this function:

◆ GetVehicleForwardSpeed()

float ACarlaWheeledVehicle::GetVehicleForwardSpeed ( ) const

Forward speed in cm/s. Might be negative if goes backwards.

Definition at line 282 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent, and UBaseCarlaMovementComponent::GetVehicleForwardSpeed().

Referenced by FAckermannController::UpdateVehicleState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetVehicleLightState()

FVehicleLightState ACarlaWheeledVehicle::GetVehicleLightState ( ) const

Definition at line 564 of file CarlaWheeledVehicle.cpp.

References InputControl.

Referenced by FCarlaServer::FPimpl::BindActions(), and FVehicleData::RecordActorData().

+ Here is the caller graph for this function:

◆ GetVehicleOrientation()

FVector ACarlaWheeledVehicle::GetVehicleOrientation ( ) const

Orientation vector of the vehicle, pointing forward.

Definition at line 287 of file CarlaWheeledVehicle.cpp.

References GetVehicleTransform().

Referenced by IsThereAnObstacleAhead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetVehiclePhysicsControl()

FVehiclePhysicsControl ACarlaWheeledVehicle::GetVehiclePhysicsControl ( ) const

◆ GetVehicleTransform()

FTransform ACarlaWheeledVehicle::GetVehicleTransform ( ) const
inline

Transform of the vehicle.

Location is shifted so it matches center of the vehicle bounds rather than the actor's location.

Definition at line 110 of file CarlaWheeledVehicle.h.

Referenced by ApplyRolloverBehavior(), and GetVehicleOrientation().

+ Here is the caller graph for this function:

◆ GetVelocity()

FVector ACarlaWheeledVehicle::GetVelocity ( ) const
overridevirtual

Definition at line 947 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent, and UBaseCarlaMovementComponent::GetVelocity().

Referenced by FSparseHighDetailMap::SaveMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWheelsFrictionScale()

TArray< float > ACarlaWheeledVehicle::GetWheelsFrictionScale ( )

Definition at line 368 of file CarlaWheeledVehicle.cpp.

Referenced by AFrictionTrigger::OnTriggerBeginOverlap(), and AFrictionTrigger::OnTriggerEndOverlap().

+ Here is the caller graph for this function:

◆ GetWheelSteerAngle()

float ACarlaWheeledVehicle::GetWheelSteerAngle ( EVehicleWheelLocation  WheelLocation)

Definition at line 876 of file CarlaWheeledVehicle.cpp.

References bPhysicsEnabled.

Referenced by FFrameData::AddVehicleWheelsAnimation(), and ACarlaRecorder::AddVehicleWheelsAnimation().

+ Here is the caller graph for this function:

◆ HoldHandbrake()

void ACarlaWheeledVehicle::HoldHandbrake ( )
inline

Definition at line 278 of file CarlaWheeledVehicle.h.

◆ IsAckermannControlActive()

bool ACarlaWheeledVehicle::IsAckermannControlActive ( ) const
inline

Definition at line 232 of file CarlaWheeledVehicle.h.

Referenced by FVehicleData::RecordActorData().

+ Here is the caller graph for this function:

◆ IsInVehicleRange()

bool ACarlaWheeledVehicle::IsInVehicleRange ( const FVector &  Location) const

Definition at line 205 of file CarlaWheeledVehicle.cpp.

References FoliageBoundingBox.

◆ IsTwoWheeledVehicle()

bool ACarlaWheeledVehicle::IsTwoWheeledVehicle ( )

Referenced by FFrameData::AddVehicleWheelsAnimation(), ACarlaRecorder::AddVehicleWheelsAnimation(), and SetWheelCollision().

+ Here is the caller graph for this function:

◆ IsTwoWheeledVehicle_Implementation()

virtual bool ACarlaWheeledVehicle::IsTwoWheeledVehicle_Implementation ( )
inlinevirtual

Definition at line 198 of file CarlaWheeledVehicle.h.

◆ OpenDoor()

void ACarlaWheeledVehicle::OpenDoor ( const EVehicleDoor  DoorIdx)

Definition at line 959 of file CarlaWheeledVehicle.cpp.

References All, ConstraintsComponents, and OpenDoorPhys().

+ Here is the call graph for this function:

◆ OpenDoorPhys()

void ACarlaWheeledVehicle::OpenDoorPhys ( const EVehicleDoor  DoorIdx)

Definition at line 993 of file CarlaWheeledVehicle.cpp.

References CollisionDisableConstraints, ConstraintDoor, ConstraintsComponents, DoorComponentsTransform, and DoorOpenStrength.

Referenced by OpenDoor(), and ResetConstraints().

+ Here is the caller graph for this function:

◆ RefreshLightState()

void ACarlaWheeledVehicle::RefreshLightState ( const FVehicleLightState VehicleLightState)
protected

Referenced by SetVehicleLightState().

+ Here is the caller graph for this function:

◆ ReleaseHandbrake()

void ACarlaWheeledVehicle::ReleaseHandbrake ( )
inline

Definition at line 284 of file CarlaWheeledVehicle.h.

◆ RemoveReferenceToManager()

void ACarlaWheeledVehicle::RemoveReferenceToManager ( )
private

Definition at line 1099 of file CarlaWheeledVehicle.cpp.

References IsValid(), and AVegetationManager::RemoveVehicle().

Referenced by EndPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetConstraints()

void ACarlaWheeledVehicle::ResetConstraints ( )
protected

Definition at line 935 of file CarlaWheeledVehicle.cpp.

References CloseDoorPhys(), ConstraintsComponents, and OpenDoorPhys().

Referenced by ApplyVehiclePhysicsControl(), BeginPlay(), and SetSimulatePhysics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RestoreVehiclePhysicsControl()

void ACarlaWheeledVehicle::RestoreVehiclePhysicsControl ( )

Definition at line 569 of file CarlaWheeledVehicle.cpp.

References ApplyVehiclePhysicsControl(), and LastPhysicsControl.

Referenced by UBaseCarlaMovementComponent::EnableUE4VehiclePhysics(), UCarSimManagerComponent::OnCarSimHit(), and UCarSimManagerComponent::OnCarSimOverlap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAIVehicleState()

void ACarlaWheeledVehicle::SetAIVehicleState ( ECarlaWheeledVehicleState  InState)
inline
Todo:
This function should be private to AWheeledVehicleAIController.

Definition at line 154 of file CarlaWheeledVehicle.h.

References State.

Referenced by AWheeledVehicleAIController::ConfigureAutopilot().

+ Here is the caller graph for this function:

◆ SetBrakeInput()

void ACarlaWheeledVehicle::SetBrakeInput ( float  Value)

Definition at line 347 of file CarlaWheeledVehicle.cpp.

References ApplyVehicleControl(), FVehicleControl::Brake, Control, and InputControl.

Referenced by AWheeledVehicleAIController::ConfigureAutopilot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetCarlaMovementComponent()

void ACarlaWheeledVehicle::SetCarlaMovementComponent ( UBaseCarlaMovementComponent MoementComponent)

Definition at line 852 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent.

Referenced by UCarSimManagerComponent::CreateCarsimComponent(), UChronoMovementComponent::CreateChronoMovementComponent(), and UDefaultMovementComponent::CreateDefaultMovementComponent().

+ Here is the caller graph for this function:

◆ SetFailureState()

void ACarlaWheeledVehicle::SetFailureState ( const carla::rpc::VehicleFailureState FailureState)

Definition at line 847 of file CarlaWheeledVehicle.cpp.

References FailureState.

Referenced by FVehicleData::RestoreActorData().

+ Here is the caller graph for this function:

◆ SetHandbrakeInput()

void ACarlaWheeledVehicle::SetHandbrakeInput ( bool  Value)

Definition at line 361 of file CarlaWheeledVehicle.cpp.

References ApplyVehicleControl(), FVehicleControl::bHandBrake, Control, and InputControl.

Referenced by AWheeledVehicleAIController::ConfigureAutopilot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPhysicsConstraintAngle()

void ACarlaWheeledVehicle::SetPhysicsConstraintAngle ( UPhysicsConstraintComponent *  Component,
const FRotator &  NewAngle 
)
static

Definition at line 1120 of file CarlaWheeledVehicle.cpp.

◆ SetReverse()

void ACarlaWheeledVehicle::SetReverse ( bool  Value)

Definition at line 354 of file CarlaWheeledVehicle.cpp.

References ApplyVehicleControl(), FVehicleControl::bReverse, Control, and InputControl.

Referenced by AWheeledVehicleAIController::ConfigureAutopilot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRolloverFlag()

void ACarlaWheeledVehicle::SetRolloverFlag ( )

Definition at line 1073 of file CarlaWheeledVehicle.cpp.

References FailureState, carla::rpc::Rollover, and RolloverBehaviorTracker.

Referenced by ApplyRolloverBehavior().

+ Here is the caller graph for this function:

◆ SetRotationAnim()

void ACarlaWheeledVehicle::SetRotationAnim ( float  Rotation)
inline

Definition at line 477 of file CarlaWheeledVehicle.h.

Referenced by CarlaReplayerHelper::ProcessReplayerAnimBiker(), and FFrameData::ProcessReplayerAnimBiker().

+ Here is the caller graph for this function:

◆ SetSimulatePhysics()

void ACarlaWheeledVehicle::SetSimulatePhysics ( bool  enabled)

Definition at line 893 of file CarlaWheeledVehicle.cpp.

References bPhysicsEnabled, and ResetConstraints().

Referenced by FVehicleData::RestoreActorData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetSpeedAnim()

void ACarlaWheeledVehicle::SetSpeedAnim ( float  Speed)
inline

Definition at line 471 of file CarlaWheeledVehicle.h.

Referenced by CarlaReplayerHelper::ProcessReplayerAnimBiker(), and FFrameData::ProcessReplayerAnimBiker().

+ Here is the caller graph for this function:

◆ SetSteeringInput()

void ACarlaWheeledVehicle::SetSteeringInput ( float  Value)

Definition at line 340 of file CarlaWheeledVehicle.cpp.

References ApplyVehicleControl(), Control, InputControl, and FVehicleControl::Steer.

Referenced by AWheeledVehicleAIController::ConfigureAutopilot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetThrottleInput()

void ACarlaWheeledVehicle::SetThrottleInput ( float  Value)

Definition at line 333 of file CarlaWheeledVehicle.cpp.

References ApplyVehicleControl(), Control, InputControl, and FVehicleControl::Throttle.

Referenced by AWheeledVehicleAIController::ConfigureAutopilot(), and UDefaultMovementComponent::ProcessControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetVehicleLightState()

void ACarlaWheeledVehicle::SetVehicleLightState ( const FVehicleLightState LightState)

Definition at line 828 of file CarlaWheeledVehicle.cpp.

References FVehicleLightState::Brake, FVehicleLightState::Fog, FVehicleLightState::HighBeam, InputControl, FVehicleLightState::Interior, FVehicleLightState::LeftBlinker, LightState, FVehicleLightState::LowBeam, FVehicleLightState::Position, RefreshLightState(), FVehicleLightState::Reverse, FVehicleLightState::RightBlinker, FVehicleLightState::Special1, and FVehicleLightState::Special2.

Referenced by FVehicleData::RestoreActorData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetWheelCollision()

void ACarlaWheeledVehicle::SetWheelCollision ( UWheeledVehicleMovementComponent4W *  Vehicle4W,
const FVehiclePhysicsControl PhysicsControl 
)

Definition at line 52 of file CarlaWheeledVehicle.cpp.

References IsTwoWheeledVehicle(), and FVehiclePhysicsControl::UseSweepWheelCollision.

Referenced by ApplyVehiclePhysicsControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetWheelCollisionNW()

void ACarlaWheeledVehicle::SetWheelCollisionNW ( UWheeledVehicleMovementComponentNW *  VehicleNW,
const FVehiclePhysicsControl PhysicsControl 
)

Definition at line 78 of file CarlaWheeledVehicle.cpp.

References FVehiclePhysicsControl::UseSweepWheelCollision.

Referenced by ApplyVehiclePhysicsControl().

+ Here is the caller graph for this function:

◆ SetWheelsFrictionScale()

void ACarlaWheeledVehicle::SetWheelsFrictionScale ( TArray< float > &  WheelsFrictionScale)

Definition at line 385 of file CarlaWheeledVehicle.cpp.

Referenced by BeginPlay(), and AFrictionTrigger::UpdateWheelsFriction().

+ Here is the caller graph for this function:

◆ SetWheelSteerDirection()

void ACarlaWheeledVehicle::SetWheelSteerDirection ( EVehicleWheelLocation  WheelLocation,
float  AngleInDeg 
)

Set the rotation of the car wheels indicated by the user 0 = FL_VehicleWheel, 1 = FR_VehicleWheel, 2 = BL_VehicleWheel, 3 = BR_VehicleWheel NOTE : This is purely aesthetic.

It will not modify the physics of the car in any way

Definition at line 861 of file CarlaWheeledVehicle.cpp.

References bPhysicsEnabled.

◆ ShowDebugTelemetry()

void ACarlaWheeledVehicle::ShowDebugTelemetry ( bool  Enabled)

Definition at line 803 of file CarlaWheeledVehicle.cpp.

References ACarlaHUD::AddDebugVehicleForTelemetry(), and ACarlaHUD::DebugVehicle.

Referenced by EndPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToggleReverse()

void ACarlaWheeledVehicle::ToggleReverse ( )
inline

Definition at line 269 of file CarlaWheeledVehicle.h.

◆ UpdateDetectionBox()

void ACarlaWheeledVehicle::UpdateDetectionBox ( )

Definition at line 212 of file CarlaWheeledVehicle.cpp.

References DetectionSize, and FoliageBoundingBox.

Member Data Documentation

◆ AckermannController

FAckermannController ACarlaWheeledVehicle::AckermannController
private

◆ bAckermannControlActive

bool ACarlaWheeledVehicle::bAckermannControlActive = false
private

Definition at line 348 of file CarlaWheeledVehicle.h.

Referenced by FlushVehicleControl().

◆ BaseMovementComponent

UBaseCarlaMovementComponent* ACarlaWheeledVehicle::BaseMovementComponent = nullptr
private

◆ bIsNWVehicle

bool ACarlaWheeledVehicle::bIsNWVehicle = false

◆ bPhysicsEnabled

bool ACarlaWheeledVehicle::bPhysicsEnabled = true
private

◆ CarSimOriginOffset

float ACarlaWheeledVehicle::CarSimOriginOffset = 150.f

Definition at line 413 of file CarlaWheeledVehicle.h.

Referenced by UCarSimManagerComponent::BeginPlay().

◆ CollisionDisableConstraints

TMap<UPrimitiveComponent*, UPhysicsConstraintComponent*> ACarlaWheeledVehicle::CollisionDisableConstraints
private

Definition at line 449 of file CarlaWheeledVehicle.h.

Referenced by BeginPlay(), and OpenDoorPhys().

◆ ConstraintComponentNames

TArray<FName> ACarlaWheeledVehicle::ConstraintComponentNames
protected

Definition at line 319 of file CarlaWheeledVehicle.h.

Referenced by BeginPlay().

◆ ConstraintDoor

TMap<UPhysicsConstraintComponent*, UPrimitiveComponent*> ACarlaWheeledVehicle::ConstraintDoor
private

Definition at line 442 of file CarlaWheeledVehicle.h.

Referenced by BeginPlay(), CloseDoorPhys(), and OpenDoorPhys().

◆ ConstraintsComponents

TArray<UPhysicsConstraintComponent*> ACarlaWheeledVehicle::ConstraintsComponents
private

◆ Control

FVehicleControl ACarlaWheeledVehicle::Control

◆ DetectionSize

float ACarlaWheeledVehicle::DetectionSize { 750.0f }

Definition at line 359 of file CarlaWheeledVehicle.h.

Referenced by GetDetectionSize(), and UpdateDetectionBox().

◆ DoorComponentsTransform

TMap<UPrimitiveComponent*, FTransform> ACarlaWheeledVehicle::DoorComponentsTransform
private

Definition at line 446 of file CarlaWheeledVehicle.h.

Referenced by BeginPlay(), CloseDoorPhys(), and OpenDoorPhys().

◆ DoorOpenStrength

float ACarlaWheeledVehicle::DoorOpenStrength = 100.0f
protected

Definition at line 322 of file CarlaWheeledVehicle.h.

Referenced by OpenDoorPhys().

◆ FailureState

carla::rpc::VehicleFailureState ACarlaWheeledVehicle::FailureState = carla::rpc::VehicleFailureState::None
private

◆ FoliageBoundingBox

FBox ACarlaWheeledVehicle::FoliageBoundingBox

◆ InputControl

struct { ... } ACarlaWheeledVehicle::InputControl

◆ LastAppliedAckermannControl

FVehicleAckermannControl ACarlaWheeledVehicle::LastAppliedAckermannControl
private

Definition at line 345 of file CarlaWheeledVehicle.h.

◆ LastAppliedControl

FVehicleControl ACarlaWheeledVehicle::LastAppliedControl
private

Definition at line 344 of file CarlaWheeledVehicle.h.

Referenced by FlushVehicleControl().

◆ LastPhysicsControl

FVehiclePhysicsControl ACarlaWheeledVehicle::LastPhysicsControl
private

◆ LightState

FVehicleLightState ACarlaWheeledVehicle::LightState

Definition at line 340 of file CarlaWheeledVehicle.h.

Referenced by SetVehicleLightState().

◆ Priority

EVehicleInputPriority ACarlaWheeledVehicle::Priority = EVehicleInputPriority::INVALID

Definition at line 338 of file CarlaWheeledVehicle.h.

◆ RolloverBehaviorForce

float ACarlaWheeledVehicle::RolloverBehaviorForce = 0.35
private

Definition at line 351 of file CarlaWheeledVehicle.h.

Referenced by CheckRollover().

◆ RolloverBehaviorTracker

int ACarlaWheeledVehicle::RolloverBehaviorTracker = 0
private

Definition at line 352 of file CarlaWheeledVehicle.h.

Referenced by ApplyRolloverBehavior(), CheckRollover(), and SetRolloverFlag().

◆ RolloverFlagTime

float ACarlaWheeledVehicle::RolloverFlagTime = 5.0f
private

Definition at line 353 of file CarlaWheeledVehicle.h.

Referenced by ApplyRolloverBehavior().

◆ RotationAnim

float ACarlaWheeledVehicle::RotationAnim { 0.0f }

Definition at line 465 of file CarlaWheeledVehicle.h.

◆ SpeedAnim

float ACarlaWheeledVehicle::SpeedAnim { 0.0f }

Definition at line 464 of file CarlaWheeledVehicle.h.

◆ State

ECarlaWheeledVehicleState ACarlaWheeledVehicle::State = ECarlaWheeledVehicleState::UNKNOWN
private

Current state of the vehicle controller (for debugging purposes).

Definition at line 331 of file CarlaWheeledVehicle.h.

◆ TimerHandler

FTimerHandle ACarlaWheeledVehicle::TimerHandler
private

Definition at line 462 of file CarlaWheeledVehicle.h.

Referenced by ApplyRolloverBehavior().

◆ VehicleBounds

UBoxComponent* ACarlaWheeledVehicle::VehicleBounds

◆ VelocityControl

UVehicleVelocityControl* ACarlaWheeledVehicle::VelocityControl
private

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