I want to develop a simple car racing game where the road is defined by a heightmap. It looks basically like this:
The player can use throttle and brake to control the car.
I'm wondering what the best approach for the physics is. I have some ideas:
Use a mass-spring system with one mass for each wheel.
Pro: Gravity affects each wheel independly, so if one wheel stands on ground and the other one floats in the air, the car rotates. Can be extended to three dimensions by adding two more wheels.
Contra: The distance between the weels varies. The system may explode (when forces amplify each other). The car will fall down if both wheels float, but the middle of the car touches ground.
Define the car's state using position, momentum, rotation and spin.
Pro: The wheel distance is constant, no springs included
Contra: very complex, hard to compute, not really extensible to a third dimension
I think there must be a better way than those.