16#include "GameFramework/CharacterMovementComponent.h"
26 SpawnTransform.AddToTranslation(FVector(0,0,15));
33 FTransform Transform = Actor->GetTransform();
36 Scale = Transform.GetScale3D();
41 AngularVelocity = Component->GetPhysicsAngularVelocityInDegrees();
53 Component->SetPhysicsLinearVelocity(
55 Component->SetPhysicsAngularVelocityInDegrees(
56 AngularVelocity,
false,
"None");
58 auto*
Character = Cast<ACharacter>(Actor);
59 auto* CarlaVehicle = Cast<ACarlaWheeledVehicle>(Actor);
61 if (CarlaVehicle !=
nullptr){
74 auto RootComponent = Component;
75 if (RootComponent !=
nullptr)
78 RootComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
103 auto Controller = Cast<AWheeledVehicleAIController>(
Vehicle->GetController());
124 Vehicle->ApplyVehicleControl(
Control, EVehicleInputPriority::Client);
131 auto Controller = Cast<AWheeledVehicleAIController>(
Vehicle->GetController());
143 auto Walker = Cast<AWalkerBase>(Actor);
144 auto Controller = Walker !=
nullptr ? Cast<AWalkerController>(Walker->GetController()) :
nullptr;
145 if (Controller !=
nullptr)
156 auto Walker = Cast<ACharacter>(Actor);
157 auto Controller = Walker !=
nullptr ? Cast<AWalkerController>(Walker->GetController()) :
nullptr;
158 if (Controller !=
nullptr)
162 auto CharacterMovement = Cast<UCharacterMovementComponent>(Walker->GetCharacterMovement());
169 FActorSpawnParameters SpawnParams;
170 SpawnParams.SpawnCollisionHandlingOverride =
171 ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
182 Model = Actor->GetClass();
184 USignComponent* TrafficSignComponent =
185 Cast<USignComponent>(TrafficSign->FindComponentByClass<USignComponent>());
186 if (TrafficSignComponent)
188 SignModel = TrafficSignComponent->GetClass();
189 SignId = TrafficSignComponent->GetSignId();
198 USignComponent* SignComponent =
199 NewObject<USignComponent>(Actor,
SignModel);
200 SignComponent->SetSignId(
SignId);
201 SignComponent->RegisterComponent();
202 SignComponent->AttachToComponent(
203 Actor->GetRootComponent(),
204 FAttachmentTransformRules::KeepRelativeTransform);
206 SignComponent->InitializeSign(GameMode->
GetMap().get());
213 FActorSpawnParameters SpawnParams;
214 SpawnParams.SpawnCollisionHandlingOverride =
215 ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
226 Model = Actor->GetClass();
228 UTrafficLightComponent* Component =
TrafficLight->GetTrafficLightComponent();
229 SignId = Component->GetSignId();
241 UTrafficLightComponent* Component =
TrafficLight->GetTrafficLightComponent();
242 Component->SetSignId(
SignId);
246 Component->InitializeSign(GameMode->
GetMap().get());
256 ASensor* Sensor = Cast<ASensor>(Actor);
264 ASensor* Sensor = Cast<ASensor>(Actor);
Base class for the CARLA Game Mode.
const boost::optional< carla::road::Map > & GetMap() const
Base class for CARLA wheeled vehicles.
void SetDataStream(FDataStream InStream)
Replace the FDataStream associated with this sensor.
FDataStream MoveDataStream()
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode)
virtual AActor * RespawnActor(UCarlaEpisode *CarlaEpisode, const FActorInfo &Info)
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode)
FTransform GetLocalTransform(UCarlaEpisode *CarlaEpisode) const
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
A view over an actor and its properties.
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
ETrafficLightState LightState
UTrafficLightController * Controller
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
TSubclassOf< AActor > Model
virtual AActor * RespawnActor(UCarlaEpisode *CarlaEpisode, const FActorInfo &Info) override
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
TSubclassOf< UObject > SignModel
virtual AActor * RespawnActor(UCarlaEpisode *CarlaEpisode, const FActorInfo &Info) override
TSubclassOf< AActor > Model
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
bool bAckermannControlActive
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
FVehicleLightState LightState
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
carla::rpc::VehicleFailureState FailureState
FVehicleAckermannControl AckermannControl
FAckermannControllerSettings AckermannControllerSettings
FVehiclePhysicsControl PhysicsControl
carla::rpc::WalkerControl WalkerControl
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode) override
FIntVector GetCurrentMapOrigin() const
AActor * SpawnActor(const FTransform &Transform, FActorDescription ActorDescription)
Spawns an actor based on ActorDescription at Transform.
AActor * ReSpawnActorWithInfo(const FTransform &Transform, FActorDescription thisActorDescription)
Spawns an actor based on ActorDescription at Transform.
static ACarlaGameModeBase * GetGameMode(const UObject *WorldContextObject)
void RemoveCarlaActorTrafficLight(FCarlaActor *CarlaActor)
const FTrafficLightStage & GetCurrentState() const
void AddCarlaActorTrafficLight(FCarlaActor *CarlaActor)
void AddTrafficLight(UTrafficLightComponent *TrafficLight)
void RemoveTrafficLight(UTrafficLightComponent *TrafficLight)
A view over an actor and its properties.
FActorDescription Description