improved F.M.x CoG calculation in car.cpp
BRIAN MARTIN Owner <[email protected]> Mon, 10 Apr 2017 07:57:17 -0400 (EDT)
| Newsgroups | gmane.games.torcs.general |
|---|---|
| Message-ID | <[email protected]> |
--===============8460292234777090404==
Content-Type: multipart/alternative;
boundary="----=_Part_73763664_1790175641.1491825437471"
------=_Part_73763664_1790175641.1491825437471
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Code for improved CoG calculation:
tdble cog = (car->statGC.z + car->wheel[i].rideHeight) - car->wheel[i].rollCenter;
//sanity check for car params
if (cog < car->wheel[i].rideHeight)
{
cog = car->wheel[i].rideHeight;
}
F.M.x += car->wheel[i].forces.z * car->wheel[i].staticPos.y + car->wheel[i].forces.y * cog; //old car->wheel[i].rollCenter;
// rollcenter was UNUSED if fix below was implemented
// roll is reduced as roll center gets closer to CG
// roll center is always lower than CG
// by having different roll center settings front vs. rear, handling characteristics can be modified
// (original comment from torcs) Eventually TODO: activate fix below and make all cars/robots fit.
//car->wheel[i].forces.y * (car->statGC.z + car->wheel[i].rideHeight);
Brian
------=_Part_73763664_1790175641.1491825437471
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><style type=3D'text/css'>p { margin: 0; }</style></head><body><=
div style=3D'font-family: times new roman,new york,times,serif; font-size: =
12pt; color: #000000'><span style=3D"white-space:pre">=09</span>Code for im=
proved CoG calculation:<br><br> tdble =
cog =3D (car->statGC.z + car->wheel[i].rideHeight) - car->wheel[i]=
.rollCenter;<br><br> //sanity check fo=
r car params<br> if (cog < car->=
wheel[i].rideHeight) <br> =
{<br> cog =
=3D car->wheel[i].rideHeight;<br> &=
nbsp; }<br><br> F.M.x +=3D=
car->wheel[i].forces.z * car->wheel[i].staticPos.y + car->w=
heel[i].forces.y * cog; //old car->=
wheel[i].rollCenter;<br> &=
nbsp; // rollcenter was UNUSED if fix below was implemented<br> =
// roll is reduced as roll cen=
ter gets closer to CG<br> =
// roll center is always lower than CG<br> &=
nbsp; // by having different roll center settings =
front vs. rear, handling characteristics can be modified<br> &nb=
sp; <br> &nbs=
p; // (original comment from torcs) Eventually TOD=
O: activate fix below and make all cars/robots fit.<br> &=
nbsp; //car->wheel[i].forces.y * (car->=
;statGC.z + car->wheel[i].rideHeight);<br><br><span style=3D"white-space=
:pre">=09</span>Brian<br></div></body></html>
------=_Part_73763664_1790175641.1491825437471--
--===============8460292234777090404==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============8460292234777090404==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Torcs-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/torcs-users
--===============8460292234777090404==--