Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
ACollisionSensor Class Reference

A sensor to register collisions. More...

#include <CollisionSensor.h>

+ Inheritance diagram for ACollisionSensor:
+ Collaboration diagram for ACollisionSensor:

Public Member Functions

 ACollisionSensor (const FObjectInitializer &ObjectInitializer)
void SetOwner (AActor *NewOwner) override
- Public Member Functions inherited from ASensor
 ASensor (const FObjectInitializer &ObjectInitializer)
virtual void BeginPlay ()
URandomEngineGetRandomEngine ()
int32 GetSeed () const
auto GetToken () const
 Return the token that allows subscribing to this sensor's stream. More...
FDataStream MoveDataStream ()
virtual void PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaSeconds)
virtual void PrePhysTick (float DeltaSeconds)
virtual void Set (const FActorDescription &Description)
void SetDataStream (FDataStream InStream)
 Replace the FDataStream associated with this sensor. More...
void SetEpisode (const UCarlaEpisode &InEpisode)
void SetSeed (int32 InSeed)
void Tick (const float DeltaTime) final

Static Public Member Functions

static FActorDefinition GetSensorDefinition ()

Private Member Functions

void OnCollisionEvent (AActor *Actor, AActor *OtherActor, FVector NormalImpulse, const FHitResult &Hit)

Additional Inherited Members

- Protected Member Functions inherited from ASensor
void EndPlay (EEndPlayReason::Type EndPlayReason) override
template<typename SensorT >
FAsyncDataStream GetDataStream (const SensorT &Self)
 Return the FDataStream associated with this sensor. More...
const UCarlaEpisodeGetEpisode () const
void PostActorCreated () override
- Protected Attributes inherited from ASensor
URandomEngineRandomEngine = nullptr
 Random Engine used to provide noise for sensor output. More...
int32 Seed = 123456789
 Seed of the pseudo-random engine. More...

Detailed Description

A sensor to register collisions.

Definition at line 19 of file CollisionSensor.h.

Constructor & Destructor Documentation

◆ ACollisionSensor()

ACollisionSensor::ACollisionSensor ( const FObjectInitializer &  ObjectInitializer)

Definition at line 16 of file CollisionSensor.cpp.

Member Function Documentation

◆ GetSensorDefinition()

FActorDefinition ACollisionSensor::GetSensorDefinition ( )

Definition at line 22 of file CollisionSensor.cpp.

References UActorBlueprintFunctionLibrary::MakeGenericSensorDefinition().

+ Here is the call graph for this function:

◆ OnCollisionEvent()

void ACollisionSensor::OnCollisionEvent ( AActor Actor,
AActor OtherActor,
FVector  NormalImpulse,
const FHitResult &  Hit 

Definition at line 41 of file CollisionSensor.cpp.

References ACarlaRecorder::AddCollision(), ASensor::Episode, ASensor::GetDataStream(), ASensor::GetEpisode(), UCarlaEpisode::GetRecorder(), ACarlaRecorder::IsEnabled(), FAsyncDataStreamTmpl< T >::Send(), and UCarlaEpisode::SerializeActor().

Referenced by SetOwner().

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

◆ SetOwner()

void ACollisionSensor::SetOwner ( AActor NewOwner)
Deregister previous owner if there was one.

Definition at line 29 of file CollisionSensor.cpp.

References OnCollisionEvent().

+ Here is the call graph for this function:

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