Having read through Marco Monster’s car physics document (from this post) I thought I’d make some adjustments to the way my cars accelerate. Turns out that I had pretty much got it right, but there was one important factor that I hadn’t considered – air resistance. This is a big one because it incorporates the square of the car’s speed. This means that as the speed of the car increases, the resistance increases exponentially. Currently I have a maximum speed limit for the car, which is a bit clumsy and I’ve never really been comfortable with, as it’s another “magic constant”. With this method the car will eventually top out all on its own and I can remove a bunch of max speed tests. Following the jump, I’ll explain how I took the equations presented in the paper and put them into Box2D to provide something useful. I’m simplifying the model as presented in the paper, since I don’t really need it all (I’ve removed mass transference, gearing, torque ratios etc.) because I’m using carts. I might put in gearing at a later date, but I’d always rather having something working first and then change it if it isn’t fun enough ![]()
(more…)
Archive for the ‘box2d’ Category
Revised Cart Physics
Friday, October 3rd, 2008Racing Game: Moving into the 3rd Dimension
Friday, September 19th, 2008So far, I’ve been working with Box2D’s debug mode, which provides a really quick way to test out your physics model to make sure it works, but doesn’t exactly look pretty. The next step was to make it look a bit better.
(more…)