From 21178b8696a4c8f234bd8959ada4822785ab7573 Mon Sep 17 00:00:00 2001 From: LuisPoveda Date: Mon, 23 Jan 2023 12:44:05 +0100 Subject: [PATCH] change all C style casts for the C++ version --- .../Plugins/Carla/Source/Carla/Game/FrameData.cpp | 4 ++-- .../Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp | 8 ++++---- .../Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/FrameData.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/FrameData.cpp index 72fe5c96d..261b927e2 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/FrameData.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/FrameData.cpp @@ -1019,8 +1019,8 @@ void FFrameData::ProcessReplayerAnimVehicleWheels(CarlaRecorderAnimWheels Vehicl for (uint32_t i = 0; i < VehicleAnimWheels.WheelValues.size(); ++i) { const WheelInfo& Element = VehicleAnimWheels.WheelValues[i]; - VehicleAnim->SetWheelRotYaw((uint8)Element.Location, Element.SteeringAngle); - VehicleAnim->SetWheelPitchAngle((uint8)Element.Location, Element.TireRotation); + VehicleAnim->SetWheelRotYaw(static_cast(Element.Location), Element.SteeringAngle); + VehicleAnim->SetWheelPitchAngle(static_cast(Element.Location), Element.TireRotation); } } diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp index fdce684f2..2526fb699 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp @@ -217,22 +217,22 @@ void ACarlaRecorder::AddVehicleWheelsAnimation(FCarlaActor *CarlaActor) WheelInfo FL; FL.Location = EVehicleWheelLocation::FL_Wheel; FL.SteeringAngle = CarlaVehicle->GetWheelSteerAngle(FL.Location); - FL.TireRotation = WheeledVehicleMovementComponent->Wheels[(uint8)FL.Location]->GetRotationAngle(); + FL.TireRotation = WheeledVehicleMovementComponent->Wheels[static_cast(FL.Location)]->GetRotationAngle(); WheelInfo FR; FR.Location = EVehicleWheelLocation::FR_Wheel; FR.SteeringAngle = CarlaVehicle->GetWheelSteerAngle(FR.Location); - FR.TireRotation = WheeledVehicleMovementComponent->Wheels[(uint8)FR.Location]->GetRotationAngle(); + FR.TireRotation = WheeledVehicleMovementComponent->Wheels[static_cast(FR.Location)]->GetRotationAngle(); WheelInfo BL; BL.Location = EVehicleWheelLocation::BL_Wheel; BL.SteeringAngle = CarlaVehicle->GetWheelSteerAngle(BL.Location); - BL.TireRotation = WheeledVehicleMovementComponent->Wheels[(uint8)BL.Location]->GetRotationAngle(); + BL.TireRotation = WheeledVehicleMovementComponent->Wheels[static_cast(BL.Location)]->GetRotationAngle(); WheelInfo BR; BR.Location = EVehicleWheelLocation::BR_Wheel; BR.SteeringAngle = CarlaVehicle->GetWheelSteerAngle(BR.Location); - BR.TireRotation = WheeledVehicleMovementComponent->Wheels[(uint8)BR.Location]->GetRotationAngle(); + BR.TireRotation = WheeledVehicleMovementComponent->Wheels[static_cast(BR.Location)]->GetRotationAngle(); Record.WheelValues.reserve(4); Record.WheelValues.push_back(FL); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp index c348ce30b..6c7abf491 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp @@ -329,8 +329,8 @@ void CarlaReplayerHelper::ProcessReplayerAnimVehicleWheels(CarlaRecorderAnimWhee for (uint32_t i = 0; i < VehicleAnimWheels.WheelValues.size(); ++i) { const WheelInfo& Element = VehicleAnimWheels.WheelValues[i]; - VehicleAnim->SetWheelRotYaw((uint8)Element.Location, Element.SteeringAngle); - VehicleAnim->SetWheelPitchAngle((uint8)Element.Location, Element.TireRotation); + VehicleAnim->SetWheelRotYaw(static_cast(Element.Location), Element.SteeringAngle); + VehicleAnim->SetWheelPitchAngle(static_cast(Element.Location), Element.TireRotation); } }