At one time I did it similar to how you're describing (using the car forward
vector). Now, however, I ignore the car vectors entirely when working with the
tires. Note that if you're doing this with longitudinal forces, chances are
the same thing is happening laterally as well (roll angle is probably effecting
both total cornering force as well as artificially lifting the car and lowering
its weight.) I now do a cross product op with the tire side vector and the
track surface normal vector. That gives the forward vector of the tire
projected onto the surface (this is the direction the longitudinal force acts
in Pacejka). Then I cross that forward vector with the surface normal to get
the side vector as it is projected onto the plane. You now have two new tire
vectors:
1) Side vector projected to plane
2) Forward vector projected to plane
This is nice because it might get rid of one of Racer's camber bugs, among
other problems. I'm pretty sure camber will be messing things up the same way,
but rotated 90 degrees.
Make sure you're calculating slip angle using the velocity vector of the tire
projected onto the surface the same way with a dot product between vector (1)
and the projected velocity vector. The idea here is to look at all this in the
road triangle's local coordinate system, hence all the projections. Slip ratio
should be calculated in a similar fashion.
Next, run through Pacejka's tire model to get Fx and Fy using slip angle and
ratio, then multiply those forces by vectors (1) and (2) above. That will give
two forces at each tire in world coordinates.
To make things easy, add the two forces together to get one resultant force.
Add this resultant force to the car in world coordinates, and voila. The
problem should go away.
After all that, you could check to see if things are working. In the absence
of camber effects in Pacejka, the car should corner at the same lateral
acceleration (producing the same tire forces) regardless of the body's roll
angle, and of course the car should not lose or gain any weight in the process.
I had this problem too and it was a *** to figure out :-) The same thing
can be done in the fore/aft direction of course.
Don't do that :-) If you do you will reduce the forward force acting on the
car while eliminating the vertical component (cos(pitch) < 1 most of the time).
The car will stop losing weight, but now it will accelerate differently
depending on pitch angle.
Instead, it's best to convert forces into their components or resultants in
whatever coordinate system you want and use them directly.
Oh, ok. I see what you mean. You might still want to take a closer look at
your anti stuff too because it's very likely that a similar problem exists
there, even though it might be covered up at the moment by the other. Your
jacking forces should be determined by the angle between the IC and contact
patch (or wheel center for whichever brake that is) and the triangle surface
normal (minus 90 degrees so it's really the angle between the road and the IC).
The jacking force can then be applied along the triangle normal. My gut tells
me this isn't quite how it works in Racer, so you'll start to see similar
problems pop up later.
Todd Wasson
Racing Software
http://www.racesimcentral.net/
My car sim
http://www.racesimcentral.net/