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>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tdble =
cog =3D (car-&gt;statGC.z + car-&gt;wheel[i].rideHeight) - car-&gt;wheel[i]=
.rollCenter;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //sanity check fo=
r car params<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (cog &lt; car-&gt;=
wheel[i].rideHeight) <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=
&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cog =
=3D car-&gt;wheel[i].rideHeight;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; F.M.x +=3D=
 car-&gt;wheel[i].forces.z * car-&gt;wheel[i].staticPos.y +&nbsp; car-&gt;w=
heel[i].forces.y * cog;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //old car-&gt;=
wheel[i].rollCenter;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp; // rollcenter was UNUSED if fix below was implemented<br>&nbsp;&nbsp;=
&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // roll is reduced as roll cen=
ter gets closer to CG<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=
&nbsp; // roll center is always lower than CG<br>&nbsp;&nbsp;&nbsp; &nbsp;&=
nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // by having different roll center settings =
front vs. rear, handling characteristics can be modified<br>&nbsp;&nbsp;&nb=
sp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbs=
p;&nbsp; &nbsp;&nbsp;&nbsp; // (original comment from torcs) Eventually TOD=
O: activate fix below and make all cars/robots fit.<br>&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //car-&gt;wheel[i].forces.y * (car-&gt=
;statGC.z + car-&gt;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==--