Unity includes the powerful PhysX physics engine, but to achieve a realistic experience you need to understand the forces involved in your simulation.
Just as it happens in real life, the weight distribution of a car determines its handling. The weight is divided between each of the four wheels, but this distribution varies as the driver accelerates, brakes and turns. For example, when braking the weight is shifted to the front wheels.
Finding the ideal center of gravity is necessary to create a realistic racing simulation. Front-heavy cars tend to understeer and rear-heavy cars to oversteer, but most important is the center of gravity height, relative to the track, that determines load transfer from side to side.
When cornering, centrifugal force acts at the center of gravity to lean the car toward the outside of the curve, increasing downward force on the outside tires. Sport car designers aim for a low center of gravity to minimize the load transfer from side to side and maximize grip.
Tyre friction and slip are another relationship to understand when adjusting vehicle dynamics. The overall friction force is usually separated into a forward component (to accelerate and brake) and a lateral component (to steer the car). In both directions, when the force acting at the tyre exceeds the grip limit, the wheel starts to spin or slide.
Since cars behave differently at different speeds, it’s necessary to monitor the vehicle’s velocity and adjust the physics parameters accordingly. A dynamic setup improves handling in a similar way as electronics are used to enhance the safety of road cars.
If you are interested in the subject, I would recommend reading the Physics of Racing Series by Brian Beckman. Even if you are not going to write your own racing engine, I always find very helpful to understand how it works.
由 u8 发表