Vehicle Physics
(Here’s an e-mail I just sent that I thought might be of general interest.)
Well, I tried creating rigid bodies for wheels. They have nice traction and braking behavior but I ran into other problems. At high speeds (~60mph) the wheels would lose alignment. Perhaps this could be mitigated by using more iterations and/or smaller time steps. Another effect I didn’t anticipate is wheel tunneling. Now that can be reduced by ray casting, but this means the wheel won’t keep up with the chassis. I guess I could put in special logic to slow down the entire vehicle, but I didn’t try that.
I went back to my ray casting model and tuned it a bit more. I found a trick that really improves handling. Basically, I just offset all traction, braking, and friction forces up from the ground. The helps to diminish roll and pitch. This can’t easily achieved with rigid body wheels.
Anyhow, it was an interesting experiment and I’m glad I tried it.
October 2nd, 2005 at 7:26 pm
I found that all I had to do to keep the wheels from going nuts at high speed was to just move them back into place each frame. By that I mean at the hub. The alignment would eventually work itself out. Not the best solution, but wheels tend to be the last link in a hierrarchy so it is not so bad. Saying that.. Raycast wheels are plenty good enough for almost all uses.
October 4th, 2005 at 10:35 pm
Yeah, I tried snapping the wheels back too. That solved the alignment problem. However, the snapping would cause the wheels to tunnel into ramps and such.
I’m using raycast wheels now and quite happy with it. The next step is to develop an implicit wheel rotational state to allow for realistic traction.
February 16th, 2007 at 9:15 am
Hi,
I do agree that a lot of physics in involved when we get in to the vehicle motion. And not only that even the movement of vehicles and humans also plays an important role in physics… I have observed this in a game called GTa(Grand Theft Auto)..
And I love gaming and I love physics but I am not able to find a perfect book for game physics. So can you please help me out.
February 16th, 2007 at 10:06 am
For a book specifically about game physics, I recommend “Physics Based Animation” by Kenny Erleben.
March 3rd, 2007 at 7:01 pm
At the moment I am using rays in my driving game, I was using spheres which looks really good at low speed (Drifting, wheel spin) but I had the high speed problem. I might try using spheres/cylinders/capsules for low speed and then rays for high speed.