/carphys

Playing around with Bevy to simulate car physics

Primary LanguageRust

Car physics simulator

I was curious about how one could implement physics of a car in a driving game for example. I found this old web page that described the equations, so I implemented some of them inside a little Bevy UI.

I use the constants given in the page for a Corvette C5 (apparently), so you can accelerate and brake and see the speed, RPM and gear used. That's all!

Controls can be clicking on the accelerate/brake pedal, using up/down on the keyboard or right/left triggers on a gamepad (tested on a PS4 controller).

This is purely for self-education, but just in case it's useful...

Screenshot

Credits

Pedal icons created by berkahicon - Flaticon

Fonts: Fira Mono and [Fira Sans](a href="https://fonts.google.com/specimen/Fira+Sans)