
The script takes into account the amount of slope over time, and wiggles appropriately, depending on some other factors, such the amount of "inertia" (this is actually just a catch-all variable that is factoring in the vehicle's mass, momentum, and the stiffness of the suspension, because I think factoring in all three is a waste of perfectly good CPU cycles), gravity, etc. It knows whether it is a positive or a negative slope, and changes the wiggles in an appropriate fashion.
Basically, what's happening when a vehicle with a loose suspension (or something that functionally acts like it) hits a dip or rise?
Well, the wheels have springs, or something that acts like springs. The vehicle's momentum, however, is greater than the counter-force of the relaxed springs. Therefore, the vehicle's body moves in an inverse way.
I could just make it bounce on the Y axis, but this really doesn't represent the forces involved very well. When a vehicle hits a serious bump or dip, it is decelerating a lot, and the angle of acceleration is now different than the vector of the vehicle's body.
Suspensions don't get rid of energy. That's impossible. They are merely spacing it out over time- a short, sharp shock becomes a longer, smoother one. When you watched that tank video, which if you didn't, I suggest you do, you can see that the tank's visual behavior is pretty much what I'm showing here- it hits a bump, the body wants to keep going in a straight line, then the suspension re-directs the force of that bump upwards, causing the body's vector to change. Then gravity takes over, bringing the vehicle back down on its springs, etc.
Here's another good video I found, showing another way real-world engineers have handled a similar problem:
http://www.youtube.com/watch?v=ieMIO626dwc
Now, I could make my vehicles "fly" a bit, like the trucks do, if the threshold exceeded either X angle or Y velocity, X angle AND Y velocity. That's what I was referring to, in my long post earlier- it's the one area where I'm not totally satisfied with the results. It'd require two GETs and one simple logic step, so I'll probably go ahead and try writing it, and if it doesn't suck, I will post another video.