Well since we have a few crazies like me who are interested in how GPL works, here's a bit on the how the computer simulation actually operates. It's not essential to know and probably has no practical application to making your car run any faster, but does give you some more insight on this wonderful program.
Inside the guts of GPL are constructs call "rigid bodies" which are used to simulate parts of the car. I think of a rigid body as being a homogeneous sphere that has no size and cannot be compressed or twisted, but it can move. In a "Six Degree of Freedom" model, a rigid body can move in six dimensions:
Linear Motion:
1) Forward or backward along the longitudinal axis
2) Left or right along the lateral axis
3) Up or down along the vertical axis
Rotational Motion:
4) Pitch about the lateral axis
5) Roll about the longitudinal axis
6) Yaw about the vertical axis
GPL uses twelve...yes, twelve different rigid bodies. They are:
1) Chassis
2) Fuel
3) Front Left Wheel Hub
4) Front Right Wheel Hub
5) Front Left Wheel
6) Front Right Wheel
7) Rear Left Wheel
8) Rear Right Wheel
9) Engine
10) Clutch
11) Outshaft--differential
12) Head--player's head
Not all of these rigid bodies are allowed six degrees of movement. The chassis and head do, but the wheels can only rotate about one axis and move up and down in another while the fuel has no freedom of movement at all.
The front wheels have hubs while the rear do not. This allows the front wheels to be steered.
Note also that the head, which simulates the driver's head, is given its own rigid body, but apparently Papy didn't have time to finish the code that would make it move independently to simulate bumps and loads on the driver.
The most important rigid body is the chassis as all the other rigid bodies are connected to it. The chassis has one other important characteristic...it has mass.
A few hundred years ago, a rather clever Englishman named Newton came up with his three laws of motion while watching apples fall on his head from a tree. His second law states that Force = Mass * Acceleration which can be rewritten as Acceleration = Force / Mass. So if we apply a given force to an object of given mass, the object will accelerate according to his formula.
GPL measures all the different forces acting on the chassis and combines them into a single force for each of the three linear directions of motion. When applied to the chassis mass, an acceleration results which between two successive time points can be used to determine the change in speed and also distance traveled for each of the three linear axes. The mathematics of how GPL does this is not fully understood as it involves solutions of differential equations and is stuff that is way, way beyond my comprehension, but this is the gist of what happens.
So GPL keeps track of the rigid body's acceleration, speed, and position and repeatedly updates these 388 times per second! No wonder that 1990s computers sputtered. GPL also keeps track of the rigid body's linear momentum (which is speed times mass) for use during collisions with other objects such as the hay bales I so often visit.
GPL does exactly the same thing for rotation. It keeps track of the rigid body's rotational acceleration, speed, and direction. And like the linear components, it also keeps track of rotational momentum which explains why your GPL car can do all those 360s coming off a tight turn.
The rotational analogs of force and mass are torque and moment of inertia. As we all know, torque is a force applied over a distance and is measured in pounds feet or some such. Moment of inertia is a harder concept to grasp, but there are formulae for figuring out the moment of inertia for all sorts of differently shaped objects. As I've mentioned before, GPL figures an overall car moment of inertia at startup and uses that throughout in its rotational computations. The formula for rotation is Acceleration = Torque / Moment of Inertia.
To wind this up, here's a list of forces that act on the chassis. As the forces act over a predefined distance, they also generate a torque on the chassis. For example, the tire acts upward through the wheel to the spring which is located outboard of the chassis based on the track size.
1) Gravity
2) ARBs
3) Springs
4) Engine
5) Clutch
6) Head!
Lee
Edited by Lee200, Aug 02 2010 - 05:17 PM.