summaryrefslogtreecommitdiffstats
path: root/src/vehicles/HandlingMgr.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-17 13:19:20 +0200
committeraap <aap@papnet.eu>2019-07-17 13:19:20 +0200
commit0f1fbf5e9a7477c6fbb7645491598e87ed2e183e (patch)
tree713a8e10b3657d4c3a0d9c20c3704e0da8f9357e /src/vehicles/HandlingMgr.cpp
parentMerge pull request #139 from Nick007J/master (diff)
downloadre3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.tar
re3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.tar.gz
re3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.tar.bz2
re3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.tar.lz
re3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.tar.xz
re3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.tar.zst
re3-0f1fbf5e9a7477c6fbb7645491598e87ed2e183e.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/HandlingMgr.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/vehicles/HandlingMgr.cpp b/src/vehicles/HandlingMgr.cpp
index 47d0564c..9bcaaf81 100644
--- a/src/vehicles/HandlingMgr.cpp
+++ b/src/vehicles/HandlingMgr.cpp
@@ -140,11 +140,11 @@ cHandlingDataMgr::LoadHandlingData(void)
case 9: handling->fTractionMultiplier = strtod(word, nil); break;
case 10: handling->fTractionLoss = strtod(word, nil); break;
case 11: handling->fTractionBias = strtod(word, nil); break;
- case 12: handling->TransmissionData.nNumberOfGears = atoi(word); break;
- case 13: handling->TransmissionData.fMaxVelocity = strtod(word, nil); break;
- case 14: handling->TransmissionData.fEngineAcceleration = strtod(word, nil) * 0.4f; break;
- case 15: handling->TransmissionData.nDriveType = word[0]; break;
- case 16: handling->TransmissionData.nEngineType = word[0]; break;
+ case 12: handling->Transmission.nNumberOfGears = atoi(word); break;
+ case 13: handling->Transmission.fMaxVelocity = strtod(word, nil); break;
+ case 14: handling->Transmission.fEngineAcceleration = strtod(word, nil) * 0.4f; break;
+ case 15: handling->Transmission.nDriveType = word[0]; break;
+ case 16: handling->Transmission.nEngineType = word[0]; break;
case 17: handling->fBrakeDeceleration = strtod(word, nil); break;
case 18: handling->fBrakeBias = strtod(word, nil); break;
case 19: handling->bABS = !!atoi(word); break;
@@ -159,7 +159,7 @@ cHandlingDataMgr::LoadHandlingData(void)
case 28: handling->fSuspensionBias = strtod(word, nil); break;
case 29:
sscanf(word, "%x", &handling->Flags);
- handling->TransmissionData.Flags = handling->Flags;
+ handling->Transmission.Flags = handling->Flags;
break;
case 30: handling->FrontLights = atoi(word); break;
case 31: handling->RearLights = atoi(word); break;
@@ -192,8 +192,8 @@ cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
// TODO: figure out what exactly is being converted here
float velocity, a, b, specificVolume;
- handling->TransmissionData.fEngineAcceleration /= 2500.0f;
- handling->TransmissionData.fMaxVelocity /= 180.0f;
+ handling->Transmission.fEngineAcceleration /= 2500.0f;
+ handling->Transmission.fMaxVelocity /= 180.0f;
handling->fBrakeDeceleration /= 2500.0f;
handling->fTurnMass = (sq(handling->Dimension.x) + sq(handling->Dimension.y)) * handling->fMass / 12.0f;
if(handling->fTurnMass < 10.0f)
@@ -205,27 +205,27 @@ cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
specificVolume = handling->Dimension.x*handling->Dimension.z*0.5f / handling->fMass; // ?
a = 0.0f;
b = 100.0f;
- velocity = handling->TransmissionData.fMaxVelocity;
+ velocity = handling->Transmission.fMaxVelocity;
while(a < b && velocity > 0.0f){
velocity -= 0.01;
- a = handling->TransmissionData.fEngineAcceleration/6.0f;
+ a = handling->Transmission.fEngineAcceleration/6.0f;
b = -velocity * (1.0f/(specificVolume * sq(velocity) + 1.0f) - 1.0f);
}
if(handling->nIdentifier == HANDLING_RCBANDIT){
- handling->TransmissionData.fUnkMaxVelocity = handling->TransmissionData.fMaxVelocity;
+ handling->Transmission.fUnkMaxVelocity = handling->Transmission.fMaxVelocity;
}else{
- handling->TransmissionData.fUnkMaxVelocity = velocity;
- handling->TransmissionData.fMaxVelocity = velocity * 1.2f;
+ handling->Transmission.fUnkMaxVelocity = velocity;
+ handling->Transmission.fMaxVelocity = velocity * 1.2f;
}
- handling->TransmissionData.fMaxReverseVelocity = -0.2f;
+ handling->Transmission.fMaxReverseVelocity = -0.2f;
- if(handling->TransmissionData.nDriveType == '4')
- handling->TransmissionData.fEngineAcceleration /= 4.0f;
+ if(handling->Transmission.nDriveType == '4')
+ handling->Transmission.fEngineAcceleration /= 4.0f;
else
- handling->TransmissionData.fEngineAcceleration /= 2.0f;
+ handling->Transmission.fEngineAcceleration /= 2.0f;
- handling->TransmissionData.InitGearRatios();
+ handling->Transmission.InitGearRatios();
}
int32