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...
 
UBoxComponent * VehicleBounds
 
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 {200.0f}
 
FBox FoliageBoundingBox
 
float CarSimOriginOffset = 150.f
 
bool bIsNWVehicle = false
 
TArray< int32 > GetFoliageInstancesCloseToVehicle (const UInstancedStaticMeshComponent *Component) const
 
void DrawFoliageBoundingBox () 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
 
virtual void BeginPlay () override
 
virtual void EndPlay (const EEndPlayReason::Type EndPlayReason)
 
void RefreshLightState (const FVehicleLightState &VehicleLightState)
 
void AdjustVehicleBounds ()
 
void ResetConstraints ()
 
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)
 

Detailed Description

Base class for CARLA wheeled vehicles.

Definition at line 70 of file CarlaWheeledVehicle.h.

Constructor & Destructor Documentation

◆ ACarlaWheeledVehicle()

ACarlaWheeledVehicle::ACarlaWheeledVehicle ( const FObjectInitializer &  ObjectInitializer)

Definition at line 34 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent, VehicleBounds, and VelocityControl.

◆ ~ACarlaWheeledVehicle()

ACarlaWheeledVehicle::~ACarlaWheeledVehicle ( )

Definition at line 49 of file CarlaWheeledVehicle.cpp.

Member Function Documentation

◆ ActivateVelocityControl()

void ACarlaWheeledVehicle::ActivateVelocityControl ( const FVector &  Velocity)

Definition at line 765 of file CarlaWheeledVehicle.cpp.

References VelocityControl.

◆ AdjustVehicleBounds()

void ACarlaWheeledVehicle::AdjustVehicleBounds ( )
protected

Definition at line 227 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 179 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 994 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 223 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 208 of file CarlaWheeledVehicle.h.

Referenced by 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 1021 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 933 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 981 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 770 of file CarlaWheeledVehicle.cpp.

References VelocityControl.

◆ DrawFoliageBoundingBox()

void ACarlaWheeledVehicle::DrawFoliageBoundingBox ( ) const

Definition at line 219 of file CarlaWheeledVehicle.cpp.

References FoliageBoundingBox.

◆ EndPlay()

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

Definition at line 911 of file CarlaWheeledVehicle.cpp.

References ShowDebugTelemetry().

+ Here is the call graph for this function:

◆ FlushVehicleControl()

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

Definition at line 290 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 167 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 158 of file CarlaWheeledVehicle.h.

References State.

◆ GetCarlaMovementComponent()

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

Definition at line 294 of file CarlaWheeledVehicle.h.

◆ GetFailureState()

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

Definition at line 1037 of file CarlaWheeledVehicle.cpp.

References FailureState.

Referenced by FVehicleData::RecordActorData().

+ Here is the caller graph for this function:

◆ GetFoliageInstancesCloseToVehicle()

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

Definition at line 211 of file CarlaWheeledVehicle.cpp.

References DetectionSize, and FoliageBoundingBox.

◆ GetMaximumSteerAngle()

float ACarlaWheeledVehicle::GetMaximumSteerAngle ( ) const

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

Definition at line 277 of file CarlaWheeledVehicle.cpp.

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

+ Here is the caller graph for this function:

◆ GetVehicleAckermannControl()

const FVehicleAckermannControl& ACarlaWheeledVehicle::GetVehicleAckermannControl ( ) const
inline

Vehicle Ackermann control currently applied to this vehicle.

Definition at line 100 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 135 of file CarlaWheeledVehicle.h.

◆ GetVehicleBoundingBoxExtent()

FVector ACarlaWheeledVehicle::GetVehicleBoundingBoxExtent ( ) const

Extent of the vehicle's bounding box.

Definition at line 272 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 267 of file CarlaWheeledVehicle.cpp.

References VehicleBounds.

◆ GetVehicleControl()

const FVehicleControl& ACarlaWheeledVehicle::GetVehicleControl ( ) const
inline

Vehicle control currently applied to this vehicle.

Definition at line 93 of file CarlaWheeledVehicle.h.

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

+ Here is the caller graph for this function:

◆ GetVehicleCurrentGear()

int32 ACarlaWheeledVehicle::GetVehicleCurrentGear ( ) const

Active gear of the vehicle.

Definition at line 262 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 252 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 536 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 257 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 108 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 906 of file CarlaWheeledVehicle.cpp.

References BaseMovementComponent, and UBaseCarlaMovementComponent::GetVelocity().

+ Here is the call graph for this function:

◆ GetWheelsFrictionScale()

TArray< float > ACarlaWheeledVehicle::GetWheelsFrictionScale ( )

Definition at line 338 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 835 of file CarlaWheeledVehicle.cpp.

References bPhysicsEnabled.

◆ HoldHandbrake()

void ACarlaWheeledVehicle::HoldHandbrake ( )
inline

Definition at line 276 of file CarlaWheeledVehicle.h.

◆ IsAckermannControlActive()

bool ACarlaWheeledVehicle::IsAckermannControlActive ( ) const
inline

Definition at line 230 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 203 of file CarlaWheeledVehicle.cpp.

References DetectionSize, and FoliageBoundingBox.

Referenced by AVegetationSpawner::UpdateProceduralInstanceCount().

+ Here is the caller graph for this function:

◆ IsTwoWheeledVehicle()

bool ACarlaWheeledVehicle::IsTwoWheeledVehicle ( )

Referenced by SetWheelCollision().

+ Here is the caller graph for this function:

◆ IsTwoWheeledVehicle_Implementation()

virtual bool ACarlaWheeledVehicle::IsTwoWheeledVehicle_Implementation ( )
inlinevirtual

Definition at line 196 of file CarlaWheeledVehicle.h.

◆ OpenDoor()

void ACarlaWheeledVehicle::OpenDoor ( const EVehicleDoor  DoorIdx)

Definition at line 916 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 950 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 282 of file CarlaWheeledVehicle.h.

◆ ResetConstraints()

void ACarlaWheeledVehicle::ResetConstraints ( )
protected

Definition at line 894 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 541 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 152 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 317 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 811 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 806 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 331 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:

◆ SetReverse()

void ACarlaWheeledVehicle::SetReverse ( bool  Value)

Definition at line 324 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 1030 of file CarlaWheeledVehicle.cpp.

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

Referenced by ApplyRolloverBehavior().

+ Here is the caller graph for this function:

◆ SetSimulatePhysics()

void ACarlaWheeledVehicle::SetSimulatePhysics ( bool  enabled)

Definition at line 852 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:

◆ SetSteeringInput()

void ACarlaWheeledVehicle::SetSteeringInput ( float  Value)

Definition at line 310 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 303 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 800 of file CarlaWheeledVehicle.cpp.

References InputControl, LightState, and RefreshLightState().

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 51 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 77 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 355 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 820 of file CarlaWheeledVehicle.cpp.

References bPhysicsEnabled.

◆ ShowDebugTelemetry()

void ACarlaWheeledVehicle::ShowDebugTelemetry ( bool  Enabled)

Definition at line 775 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 267 of file CarlaWheeledVehicle.h.

Member Data Documentation

◆ AckermannController

FAckermannController ACarlaWheeledVehicle::AckermannController
private

◆ bAckermannControlActive

bool ACarlaWheeledVehicle::bAckermannControlActive = false
private

Definition at line 349 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 399 of file CarlaWheeledVehicle.h.

Referenced by UCarSimManagerComponent::BeginPlay().

◆ CollisionDisableConstraints

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

Definition at line 429 of file CarlaWheeledVehicle.h.

Referenced by BeginPlay(), and OpenDoorPhys().

◆ ConstraintComponentNames

TArray<FName> ACarlaWheeledVehicle::ConstraintComponentNames
protected

Definition at line 317 of file CarlaWheeledVehicle.h.

Referenced by BeginPlay().

◆ ConstraintDoor

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

Definition at line 422 of file CarlaWheeledVehicle.h.

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

◆ ConstraintsComponents

TArray<UPhysicsConstraintComponent*> ACarlaWheeledVehicle::ConstraintsComponents
private

◆ Control

FVehicleControl ACarlaWheeledVehicle::Control

◆ DetectionSize

float ACarlaWheeledVehicle::DetectionSize {200.0f}

Definition at line 360 of file CarlaWheeledVehicle.h.

Referenced by GetFoliageInstancesCloseToVehicle(), and IsInVehicleRange().

◆ DoorComponentsTransform

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

Definition at line 426 of file CarlaWheeledVehicle.h.

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

◆ DoorOpenStrength

float ACarlaWheeledVehicle::DoorOpenStrength = 100.0f
protected

Definition at line 320 of file CarlaWheeledVehicle.h.

Referenced by OpenDoorPhys().

◆ FailureState

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

◆ FoliageBoundingBox

FBox ACarlaWheeledVehicle::FoliageBoundingBox
mutable

◆ InputControl

struct { ... } ACarlaWheeledVehicle::InputControl

◆ LastAppliedAckermannControl

FVehicleAckermannControl ACarlaWheeledVehicle::LastAppliedAckermannControl
private

Definition at line 346 of file CarlaWheeledVehicle.h.

◆ LastAppliedControl

FVehicleControl ACarlaWheeledVehicle::LastAppliedControl
private

Definition at line 345 of file CarlaWheeledVehicle.h.

Referenced by FlushVehicleControl().

◆ LastPhysicsControl

FVehiclePhysicsControl ACarlaWheeledVehicle::LastPhysicsControl
private

◆ LightState

FVehicleLightState ACarlaWheeledVehicle::LightState

Definition at line 341 of file CarlaWheeledVehicle.h.

Referenced by SetVehicleLightState().

◆ Priority

EVehicleInputPriority ACarlaWheeledVehicle::Priority = EVehicleInputPriority::INVALID

Definition at line 339 of file CarlaWheeledVehicle.h.

◆ RolloverBehaviorForce

float ACarlaWheeledVehicle::RolloverBehaviorForce = 0.35
private

Definition at line 352 of file CarlaWheeledVehicle.h.

Referenced by CheckRollover().

◆ RolloverBehaviorTracker

int ACarlaWheeledVehicle::RolloverBehaviorTracker = 0
private

Definition at line 353 of file CarlaWheeledVehicle.h.

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

◆ RolloverFlagTime

float ACarlaWheeledVehicle::RolloverFlagTime = 5.0f
private

Definition at line 354 of file CarlaWheeledVehicle.h.

Referenced by ApplyRolloverBehavior().

◆ State

ECarlaWheeledVehicleState ACarlaWheeledVehicle::State = ECarlaWheeledVehicleState::UNKNOWN
private

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

Definition at line 329 of file CarlaWheeledVehicle.h.

◆ TimerHandler

FTimerHandle ACarlaWheeledVehicle::TimerHandler
private

Definition at line 438 of file CarlaWheeledVehicle.h.

Referenced by ApplyRolloverBehavior().

◆ VehicleBounds

UBoxComponent* ACarlaWheeledVehicle::VehicleBounds
private

◆ VelocityControl

UVehicleVelocityControl* ACarlaWheeledVehicle::VelocityControl
private

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