Merge pull request #1385 from carla-simulator/manishthani/expose_physx_fixes
Manishthani/expose physx fixes
This commit is contained in:
commit
9ac48388bd
|
@ -7,6 +7,7 @@
|
|||
* Added `id` property to waypoints, uniquely identifying waypoints up to half centimetre precision
|
||||
* Added OpenDrive's road offset `s` as property to waypoints
|
||||
* Fixed python client DLL error on Windows
|
||||
* Fixed wheel's tire friction from physics control parameters.
|
||||
* Fixed cleanup of local_planner when used by other modules
|
||||
|
||||
## CARLA 0.9.4
|
||||
|
|
|
@ -220,13 +220,25 @@ void ACarlaWheeledVehicle::ApplyVehiclePhysicsControl(const FVehiclePhysicsContr
|
|||
Vehicle4W->SteeringCurve.EditorCurveData = PhysicsControl.SteeringCurve;
|
||||
|
||||
// Wheels Setup
|
||||
for (int32 i = 0; i < PhysicsControl.Wheels.Num(); ++i)
|
||||
TArray<FWheelSetup> NewWheelSetups = Vehicle4W->WheelSetups;
|
||||
|
||||
for (int32 i = 0; i < Vehicle4W->WheelSetups.Num(); ++i)
|
||||
{
|
||||
Vehicle4W->Wheels[i]->DampingRate = PhysicsControl.Wheels[i].DampingRate;
|
||||
Vehicle4W->Wheels[i]->SteerAngle = PhysicsControl.Wheels[i].SteerAngle;
|
||||
Vehicle4W->Wheels[i]->GetWheelSetup().bDisableSteering = PhysicsControl.Wheels[i].bDisableSteering;
|
||||
Vehicle4W->Wheels[i]->TireConfig->SetFrictionScale(PhysicsControl.Wheels[i].TireFriction);
|
||||
UVehicleWheel *Wheel = NewWheelSetups[i].WheelClass.GetDefaultObject();
|
||||
|
||||
Wheel->DampingRate = PhysicsControl.Wheels[i].DampingRate;
|
||||
Wheel->SteerAngle = PhysicsControl.Wheels[i].SteerAngle;
|
||||
NewWheelSetups[i].bDisableSteering = PhysicsControl.Wheels[i].bDisableSteering;
|
||||
|
||||
// Assigning new tire config
|
||||
Wheel->TireConfig = NewObject<UTireConfig>();
|
||||
|
||||
// Setting a new value to friction
|
||||
Wheel->TireConfig->SetFrictionScale(PhysicsControl.Wheels[i].TireFriction);
|
||||
|
||||
}
|
||||
|
||||
Vehicle4W->WheelSetups = NewWheelSetups;
|
||||
|
||||
Vehicle4W->RecreatePhysicsState();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue