Custom car physics solution

Last couple of weeks I’ve been working on a car physics project. It uses pacejka 94 formulas for longitudal, lateral, aligning forces and uses the beckman method for combined forces.

Since I’ve seen quite a few threads on here struggling with writing their own custom wheelcollider I’m open to sharing the source code once I’ve commented everything and cleaned up the code a bit in exchange for feedback. I’ve linked a downloadable demo below. (The track and the engine sounds were NOT created by me, they were exported from rfactor and belongs to their respective creators).

Link :

Controls :
W, up arrow - throttle
S, down arrow - brakes
D, A, right arrow, left arrow - steering
E - shift up
Q - shift down
C - switch camera
UI :
Guage show RPM / 100
Current gear is displayed on the left side of the guage.
Green box shows throttle
Red box shows brakes
Blue box shows clutch, but it isn’t implemented yet.

If you have any questions or suggestions I’d be more than happy to answer them!

BTW beware of the chicane

1 Like

That’s a great start, any chance of an external camera, I find it much easier to judge the physics if I can see what the car is doing.

https://drive.google.com/file/d/1KdZmjbohySpYChOR850wC3w7S-f2nOfP/view?usp=sharing

Here is a build with an adjustable camera use C to change it.

The suspension model has been replaced. It can now simulate dynamic camber, dynamic toe in, and ackerman. I’m also working on a custom gizmos for the wheel editor :

I’m working on a day/night cycle system which currently (quite poorly) fakes scattering and has support for dynamic clouds etc. I’ve also been working a lot on physics. There’s also a new build availible for those who want to try it : build04.rar - Google Drive

Controls :
W, up arrow - throttle
S, down arrow - brakes
D, A, right arrow, left arrow - steering
E - shift up
Q - shift down
C - switch camera

1 Like

The physics is pretty great, good work. Waiting for the future updates