CARLA
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
AFrictionTrigger Class Reference

#include <FrictionTrigger.h>

+ Inheritance diagram for AFrictionTrigger:
+ Collaboration diagram for AFrictionTrigger:

Public Member Functions

 AFrictionTrigger (const FObjectInitializer &ObjectInitializer)
 
void OnTriggerBeginOverlap (UPrimitiveComponent *OverlappedComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
 
void OnTriggerEndOverlap (UPrimitiveComponent *OverlappedComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
 
void SetBoxExtent (const FVector &Extent)
 
void SetEpisode (const UCarlaEpisode &InEpisode)
 
void SetFriction (float NewFriction)
 

Public Attributes

const UCarlaEpisodeEpisode = nullptr
 
float Friction = 0.0f
 
UBoxComponent * TriggerVolume
 

Protected Member Functions

virtual void BeginPlay () override
 
virtual void EndPlay (EEndPlayReason::Type EndPlayReason) override
 
virtual void Tick (float DeltaTime) override
 

Protected Attributes

TArray< float > OldFrictionValues
 

Private Member Functions

void Init ()
 
void UpdateWheelsFriction (AActor *OtherActor, TArray< float > &NewFriction)
 

Detailed Description

Definition at line 14 of file FrictionTrigger.h.

Constructor & Destructor Documentation

◆ AFrictionTrigger()

AFrictionTrigger::AFrictionTrigger ( const FObjectInitializer &  ObjectInitializer)

Definition at line 9 of file FrictionTrigger.cpp.

References TriggerVolume.

Member Function Documentation

◆ BeginPlay()

void AFrictionTrigger::BeginPlay ( )
overrideprotectedvirtual

Definition at line 81 of file FrictionTrigger.cpp.

References Init().

+ Here is the call graph for this function:

◆ EndPlay()

void AFrictionTrigger::EndPlay ( EEndPlayReason::Type  EndPlayReason)
overrideprotectedvirtual

Definition at line 87 of file FrictionTrigger.cpp.

References OnTriggerBeginOverlap(), OnTriggerEndOverlap(), and TriggerVolume.

+ Here is the call graph for this function:

◆ Init()

void AFrictionTrigger::Init ( )
private

Definition at line 23 of file FrictionTrigger.cpp.

References OnTriggerBeginOverlap(), OnTriggerEndOverlap(), and TriggerVolume.

Referenced by BeginPlay().

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

◆ OnTriggerBeginOverlap()

void AFrictionTrigger::OnTriggerBeginOverlap ( UPrimitiveComponent OverlappedComp,
AActor OtherActor,
UPrimitiveComponent OtherComp,
int32  OtherBodyIndex,
bool  bFromSweep,
const FHitResult &  SweepResult 
)

Definition at line 45 of file FrictionTrigger.cpp.

References Friction, ACarlaWheeledVehicle::GetWheelsFrictionScale(), OldFrictionValues, UpdateWheelsFriction(), and Vehicle.

Referenced by EndPlay(), and Init().

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

◆ OnTriggerEndOverlap()

void AFrictionTrigger::OnTriggerEndOverlap ( UPrimitiveComponent OverlappedComp,
AActor OtherActor,
UPrimitiveComponent OtherComp,
int32  OtherBodyIndex 
)

Definition at line 64 of file FrictionTrigger.cpp.

References ACarlaWheeledVehicle::GetWheelsFrictionScale(), OldFrictionValues, UpdateWheelsFriction(), and Vehicle.

Referenced by EndPlay(), and Init().

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

◆ SetBoxExtent()

void AFrictionTrigger::SetBoxExtent ( const FVector &  Extent)
inline

Definition at line 49 of file FrictionTrigger.h.

References TriggerVolume.

◆ SetEpisode()

void AFrictionTrigger::SetEpisode ( const UCarlaEpisode InEpisode)
inline

Definition at line 44 of file FrictionTrigger.h.

◆ SetFriction()

void AFrictionTrigger::SetFriction ( float  NewFriction)
inline

Definition at line 54 of file FrictionTrigger.h.

◆ Tick()

void AFrictionTrigger::Tick ( float  DeltaTime)
overrideprotectedvirtual

Definition at line 104 of file FrictionTrigger.cpp.

◆ UpdateWheelsFriction()

void AFrictionTrigger::UpdateWheelsFriction ( AActor OtherActor,
TArray< float > &  NewFriction 
)
private

Definition at line 38 of file FrictionTrigger.cpp.

References ACarlaWheeledVehicle::SetWheelsFrictionScale(), and Vehicle.

Referenced by OnTriggerBeginOverlap(), and OnTriggerEndOverlap().

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

Member Data Documentation

◆ Episode

const UCarlaEpisode* AFrictionTrigger::Episode = nullptr

Definition at line 78 of file FrictionTrigger.h.

◆ Friction

float AFrictionTrigger::Friction = 0.0f

Definition at line 73 of file FrictionTrigger.h.

Referenced by ACarlaWheeledVehicle::BeginPlay(), and OnTriggerBeginOverlap().

◆ OldFrictionValues

TArray<float> AFrictionTrigger::OldFrictionValues
protected

Definition at line 68 of file FrictionTrigger.h.

Referenced by OnTriggerBeginOverlap(), and OnTriggerEndOverlap().

◆ TriggerVolume

UBoxComponent* AFrictionTrigger::TriggerVolume

Definition at line 76 of file FrictionTrigger.h.

Referenced by AFrictionTrigger(), EndPlay(), and Init().


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