diff options
author | aap <aap@papnet.eu> | 2020-12-28 21:58:21 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-12-28 21:58:21 +0100 |
commit | c93fb5e443f9afe082abf708918fcd3db807596d (patch) | |
tree | 5c53034b5581a63aee7d9e2e48f461590e2a8051 /src/vehicles | |
parent | multiple instances sema fix (diff) | |
download | re3-c93fb5e443f9afe082abf708918fcd3db807596d.tar re3-c93fb5e443f9afe082abf708918fcd3db807596d.tar.gz re3-c93fb5e443f9afe082abf708918fcd3db807596d.tar.bz2 re3-c93fb5e443f9afe082abf708918fcd3db807596d.tar.lz re3-c93fb5e443f9afe082abf708918fcd3db807596d.tar.xz re3-c93fb5e443f9afe082abf708918fcd3db807596d.tar.zst re3-c93fb5e443f9afe082abf708918fcd3db807596d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/vehicles/Vehicle.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 56de3562..3beacad5 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -877,6 +877,7 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon } if(fwd != 0.0f || right != 0.0f){ +#if 1 CVector totalSpeed = fwd*wheelFwd + right*wheelRight; CVector turnDirection = totalSpeed; @@ -910,6 +911,17 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon ApplyMoveForce(impulse * direction); ApplyTurnForce(turnImpulse * direction, wheelContactPoint); +#else + CVector direction = fwd*wheelFwd + right*wheelRight; + float speed = direction.Magnitude(); + direction.Normalise(); + + float impulse = speed*m_fMass; + float turnImpulse = speed*GetMass(wheelContactPoint, direction); + + ApplyMoveForce(impulse * direction); + ApplyTurnForce(turnImpulse * direction, wheelContactPoint); +#endif } } |