15 DefaultMovementComponent->RegisterComponent();
25 auto *MovementComponent =
CarlaVehicle->GetVehicleMovementComponent();
27 MovementComponent->SetSteeringInput(Control.
Steer);
28 MovementComponent->SetBrakeInput(Control.
Brake);
29 MovementComponent->SetHandbrakeInput(Control.
bHandBrake);
32 MovementComponent->SetUseAutoGears(!Control.
bReverse);
33 MovementComponent->SetTargetGear(Control.
bReverse ? -1 : 1,
true);
40 MovementComponent->SetTargetGear(Control.
Gear,
true);
43 Control.
Gear = MovementComponent->GetCurrentGear();
50 return CarlaVehicle->GetVehicleMovementComponent()->GetCurrentGear();
55 return CarlaVehicle->GetVehicleMovementComponent()->GetForwardSpeed();
void SetThrottleInput(float Value)
ACarlaWheeledVehicle * CarlaVehicle
void ProcessControl(FVehicleControl &Control) override
const FVehicleControl & GetVehicleControl() const
Vehicle control currently applied to this vehicle.
int32 GetVehicleCurrentGear() const override
virtual void BeginPlay() override
float GetVehicleForwardSpeed() const override
Base class for CARLA wheeled vehicles.
static void CreateDefaultMovementComponent(ACarlaWheeledVehicle *Vehicle)
void SetCarlaMovementComponent(UBaseCarlaMovementComponent *MoementComponent)