Allow GetVehiclePhysicsControl to succeed when physics is off
This commit is contained in:
parent
d7228f7467
commit
fda970b881
|
@ -459,17 +459,25 @@ FVehiclePhysicsControl ACarlaWheeledVehicle::GetVehiclePhysicsControl() const
|
|||
{
|
||||
FWheelPhysicsControl PhysicsWheel;
|
||||
|
||||
PxVehicleWheelData PWheelData = Vehicle4W->PVehicle->mWheelsSimData.getWheelData(i);
|
||||
PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
|
||||
PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
|
||||
PhysicsWheel.Radius = PWheelData.mRadius;
|
||||
PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
|
||||
PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
|
||||
if (bPhysicsEnabled) {
|
||||
PxVehicleWheelData PWheelData = Vehicle4W->PVehicle->mWheelsSimData.getWheelData(i);
|
||||
|
||||
PxVehicleTireData PTireData = Vehicle4W->PVehicle->mWheelsSimData.getTireData(i);
|
||||
PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
|
||||
PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
|
||||
PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
|
||||
PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
|
||||
PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
|
||||
PhysicsWheel.Radius = PWheelData.mRadius;
|
||||
PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
|
||||
PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
|
||||
|
||||
PxVehicleTireData PTireData = Vehicle4W->PVehicle->mWheelsSimData.getTireData(i);
|
||||
|
||||
PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
|
||||
PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
|
||||
PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
|
||||
} else {
|
||||
if (i < LastPhysicsControl.Wheels.Num()) {
|
||||
PhysicsWheel = LastPhysicsControl.Wheels[i];
|
||||
}
|
||||
}
|
||||
|
||||
PhysicsWheel.TireFriction = Vehicle4W->Wheels[i]->TireConfig->GetFrictionScale();
|
||||
PhysicsWheel.Position = Vehicle4W->Wheels[i]->Location;
|
||||
|
@ -537,17 +545,23 @@ FVehiclePhysicsControl ACarlaWheeledVehicle::GetVehiclePhysicsControl() const
|
|||
{
|
||||
FWheelPhysicsControl PhysicsWheel;
|
||||
|
||||
PxVehicleWheelData PWheelData = VehicleNW->PVehicle->mWheelsSimData.getWheelData(i);
|
||||
PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
|
||||
PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
|
||||
PhysicsWheel.Radius = PWheelData.mRadius;
|
||||
PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
|
||||
PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
|
||||
if (bPhysicsEnabled) {
|
||||
PxVehicleWheelData PWheelData = VehicleNW->PVehicle->mWheelsSimData.getWheelData(i);
|
||||
PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
|
||||
PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
|
||||
PhysicsWheel.Radius = PWheelData.mRadius;
|
||||
PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
|
||||
PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
|
||||
|
||||
PxVehicleTireData PTireData = VehicleNW->PVehicle->mWheelsSimData.getTireData(i);
|
||||
PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
|
||||
PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
|
||||
PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
|
||||
PxVehicleTireData PTireData = VehicleNW->PVehicle->mWheelsSimData.getTireData(i);
|
||||
PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
|
||||
PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
|
||||
PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
|
||||
} else {
|
||||
if (i < LastPhysicsControl.Wheels.Num()) {
|
||||
PhysicsWheel = LastPhysicsControl.Wheels[i];
|
||||
}
|
||||
}
|
||||
|
||||
PhysicsWheel.TireFriction = VehicleNW->Wheels[i]->TireConfig->GetFrictionScale();
|
||||
PhysicsWheel.Position = VehicleNW->Wheels[i]->Location;
|
||||
|
|
Loading…
Reference in New Issue