diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2020-12-29 18:51:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-29 18:51:37 +0100 |
commit | 89e27093040067ca80ce2e174c19427222167e8e (patch) | |
tree | bf4183a78beb0c3e747fbc1f6a8c4f3c1e114d5c /src/vehicles/HandlingMgr.cpp | |
parent | master gxt (diff) | |
parent | Reorder CEntity functions into their original order (diff) | |
download | re3-89e27093040067ca80ce2e174c19427222167e8e.tar re3-89e27093040067ca80ce2e174c19427222167e8e.tar.gz re3-89e27093040067ca80ce2e174c19427222167e8e.tar.bz2 re3-89e27093040067ca80ce2e174c19427222167e8e.tar.lz re3-89e27093040067ca80ce2e174c19427222167e8e.tar.xz re3-89e27093040067ca80ce2e174c19427222167e8e.tar.zst re3-89e27093040067ca80ce2e174c19427222167e8e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/vehicles/HandlingMgr.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vehicles/HandlingMgr.cpp b/src/vehicles/HandlingMgr.cpp index 18a2481e..3ac6f057 100644 --- a/src/vehicles/HandlingMgr.cpp +++ b/src/vehicles/HandlingMgr.cpp @@ -2,6 +2,7 @@ #include "main.h" #include "FileMgr.h" +#include "Physical.h" #include "HandlingMgr.h" cHandlingDataMgr mod_HandlingManager; @@ -115,7 +116,7 @@ cHandlingDataMgr::LoadHandlingData(void) end = start+1; // yeah, this is kinda crappy - if(strncmp(line, ";the end", 9) == 0) + if(strcmp(line, ";the end") == 0) keepGoing = 0; else if(line[0] != ';'){ field = 0; @@ -189,17 +190,17 @@ cHandlingDataMgr::FindExactWord(const char *word, const char *words, int wordLen void cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling) { - // TODO: figure out what exactly is being converted here + // acceleration is in ms^-2, but we need mf^-2 where f is one frame time (50fps) float velocity, a, b, specificVolume; - handling->Transmission.fEngineAcceleration /= 2500.0f; - handling->Transmission.fMaxVelocity /= 180.0f; - handling->fBrakeDeceleration /= 2500.0f; + handling->Transmission.fEngineAcceleration *= 1.0f/(50.0f*50.0f); + handling->Transmission.fMaxVelocity *= 1000.0f/(60.0f*60.0f * 50.0f); + handling->fBrakeDeceleration *= 1.0f/(50.0f*50.0f); handling->fTurnMass = (sq(handling->Dimension.x) + sq(handling->Dimension.y)) * handling->fMass / 12.0f; if(handling->fTurnMass < 10.0f) handling->fTurnMass *= 5.0f; handling->fInvMass = 1.0f/handling->fMass; - handling->fBuoyancy = 100.0f/handling->nPercentSubmerged * 0.008f*handling->fMass; + handling->fBuoyancy = 100.0f/handling->nPercentSubmerged * GRAVITY*handling->fMass; // What the hell is going on here? specificVolume = handling->Dimension.x*handling->Dimension.z*0.5f / handling->fMass; // ? |