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.

5 Responses to “Vehicle Physics”

  1. Billy Zelsnack Says:

    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.

  2. Erin Catto Says:

    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.

  3. amarnath Says:

    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.

  4. Erin Catto Says:

    For a book specifically about game physics, I recommend “Physics Based Animation” by Kenny Erleben.

  5. Chris Pilkington Says:

    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.

Leave a Reply