Re: simuv2 bug update
Christos Dimitrakakis <[email protected]>
| Newsgroups | gmane.games.torcs.general |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brian Martin wrote:
| I have done a lot of testing since my last post. Two cars will behave
| unnaturally when they become air-born. The cars will stand up on one
| or two wheels and slowly settle on the track. The cars will then drive
| normally. Again, this problem occurs with a combination of low mass
| and high spring pressure.
|
OK, this makes sense. I will test later and include in the main code.
| This code change will solve the problem:
|
| In wheel.cpp:
|
| void SimWheelUpdateRide(tCar *car, int index)
| {
| tWheel *wheel = &(car->wheel[index]);
| tdble Zroad;
|
| // compute suspension travel
| RtTrackGlobal2Local(car->trkPos.seg, wheel->pos.x, wheel->pos.y,
| &(wheel->trkPos), TR_LPOS_SEGMENT);
| wheel->zRoad = Zroad = RtTrackHeightL(&(wheel->trkPos));
|
|
| // Wheel susp.x is not the wheel movement, look at SimSuspCheckIn,
| it becomes there scaled with
| // susp->spring.bellcrank, so we invert this here.
| //tdble prexwheel = wheel->susp.x / wheel->susp.spring.bellcrank;
|
| // unreliable value tdble new_susp_x= prexwheel - wheel->rel_vel *
| SimDeltaTime;
|
|
| tdble max_extend = wheel->pos.z - Zroad;
| wheel->rideHeight = max_extend;
|
| //////////////////////test///////////////////
| tdble prex = wheel->susp.x;
| //////////////////////////////////////////////////
|
|
| if (max_extend < wheel->susp.x) {
| wheel->susp.x = max_extend;
| wheel->rel_vel = 0.0f;
| } else if (wheel->susp.x < wheel->susp.spring.packers) {
| //////////////test (fixes elevated car at race start for most
| cars)///
| wheel->susp.x = wheel->susp.spring.packers;
| /////////////////////////////////////////////////////
| wheel->rel_vel = 0.0f;
| ///////////////test fixes all mispositioned car problems/////
| }else{
| //wheel->susp.x = new_susp_x;
| wheel->susp.x = wheel->pos.z - Zroad;
| }
| //////////////////////////////////////////////////////////////
|
| // tdble prex = wheel->susp.x;
|
|
| // wheel->susp.x = new_susp_x;
|
|
| // verify the suspension travel, beware, wheel->susp.x will be
| scaled by SimSuspCheckIn
| SimSuspCheckIn(&(wheel->susp));
| wheel->susp.v = (prex - wheel->susp.x) / SimDeltaTime;
|
| // update wheel brake
| SimBrakeUpdate(car, wheel, &(wheel->brake));
|
| }
|
| This code will also solve the problem of simuv going berzerk with huge
| damper rebound values.
|
|
-
------------------------------------------------------------------------------
| _______________________________________________
| Torcs-users mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/torcs-users
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFKRpgTyBv6kELa61sRAnXgAJ9nmjpn/UsERIGHoBNtybIC93qLvwCgjx/6
XeootWSbW9MVf82ck9fsunw=
=bOQz
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------