25 UE_LOG(LogCarla, Warning, TEXT(
"Error: Owner is not properly set for UBaseCarlaMovementComponent") );
57 UE_LOG(LogCarla, Warning, TEXT(
"Error: Owner is not properly set for UCarSimManagerComponent") );
60 CarlaVehicle->GetVehicleMovementComponent()->SetComponentTickEnabled(
false);
61 CarlaVehicle->GetVehicleMovementComponent()->Deactivate();
62 CarlaVehicle->GetMesh()->PhysicsTransformUpdateMode = EPhysicsTransformUpdateMode::ComponentTransformIsKinematic;
63 auto * Bone =
CarlaVehicle->GetMesh()->GetBodyInstance(NAME_None);
66 Bone->SetInstanceSimulatePhysics(
false);
73 FVector CurrentVelocity(0, 0, 0);
78 CarlaVehicle->GetMesh()->SetPhysicsLinearVelocity(CurrentVelocity,
false,
"Vehicle_Base");
79 CarlaVehicle->GetVehicleMovementComponent()->SetComponentTickEnabled(
true);
81 CarlaVehicle->GetMesh()->PhysicsTransformUpdateMode = EPhysicsTransformUpdateMode::SimulationUpatesComponentTransform;
82 auto * Bone =
CarlaVehicle->GetMesh()->GetBodyInstance(NAME_None);
85 Bone->SetInstanceSimulatePhysics(
true);
91 CarlaVehicle->GetMesh()->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Block);
92 CarlaVehicle->GetMesh()->SetCollisionProfileName(
"Vehicle");
virtual void ProcessControl(FVehicleControl &Control)
void RestoreVehiclePhysicsControl()
void DisableUE4VehiclePhysics()
virtual FVector GetVelocity() const
ACarlaWheeledVehicle * CarlaVehicle
virtual void BeginPlay() override
static void log_warning(Args &&... args)
virtual int32 GetVehicleCurrentGear() const
virtual float GetVehicleForwardSpeed() const
void EnableUE4VehiclePhysics(bool bResetVelocity=true)
Base class for CARLA wheeled vehicles.