Another little demo.
Revisited my vehicle physics implementation and made a number of improvements with regards to stability and handling. It's getting there but is still incomplete/requires tweaking.
The one improvement that was crucial to make the car drivable (and not spin out at the slightest of steering input) is to properly filter the users controls.
For example, if you drive around at 200 kmh you won't be able to keep the car stable if the player steers in one direction and the front tires turn to fast in the given direcion with a too large of an slip angle. So in this case i defined a curve where the players input slows down and the steering wheel angle gets reduced if the vehicle speed on the road increases.
Also, another improvement (which massively helps with drifting) is to allow the car to "autocorrect" the frontwheels in the direction of travel. This increases the stability as the car automatically steers in the desired direction during a drift to keep the car stable and avoid a spinout. (The player can still adjust the front tire angle to control the drift.)
Internally the vehicle physics is calculated at 100fps.
The last vehicle demo shown on this channel was using PhysX as the underlying physics engine. This one is using the Jolt physics library.
The city model was a free 3d model i found on 3d model sharing sites (i think it was turbosquid).
The 3d car was made by me to test out a different modelling technique for cars with panel gaps.
It's getting really close to becoming usable in a small racing game.
Ещё видео!