Car Physics Learnig
Car Physics Learnig
- If this were the only force, the car would accelerate to infinite speeds.
Clearly, this is not the case in real life. Enter the resistance forces. The
first and usually the most important one is air resistance, a.k.a. aerodynamic
drag. This force is so important because it is proportional to the square of the
velocity.
When we're driving fast (and which game doesn't involve high speeds?) this
becomes the most important resistance force
- The acceleration (a) of the car (in meters per second squared) is determined by
the net force on the car (in Newton) and the car's mass M (in kilogram) via
Newton's second law:
2. Braking
- When braking, the traction force is replaced by a braking force which is oriented
in the opposite direction. The total longtitudinal force is then the vector sum of
these three forces.
- In this model the braking force is a constant. Keep in mind to stop applying the
braking force as soon as the speed is reduced to zero otherwise the car will end up
going in reverse.
3 Weight Transfer
- An important effect when accelerating or braking is the effect of dynamic weight
transfer. When braking hard the car will nosedive. During accelerating, the car
leans back. This is because just like the driver is pushed back in his seat when
the pedal hits the metal, so is the car's centre of mass.
The effect of this is that the weight on the rear wheels increases during
acceleration and the front wheels conversely have less weight to bear.
- The effect of weight transfer is important for driving games for two reasons.
First of all the visual effect of the car pitching in response to driver actions
adds a lot of realism to the game. Suddenly, the simulation becomes a lot more
lifelike in the user's experience.
- Second of all, the weight distribution dramatically affects the maximum traction
force per wheel. This is because there is a friction limit for a wheel that is
proportional to the load on that wheel.
4. Engine Force
- When I said earlier that the engine delivers a certain amount of force, this was
a a bit of a simplification. An engine delivers an amount of torque. Torque is
like a rotational equivalent of force. Torque is force times distance. If you apply
a 10 Newton force at 0.3 meters of the axis of rotation, you've got a torque of 10
x 0.3 = 3 N.m (Newton meter). That's the same torque as when you apply a 1 N force
at 3 m from the axis. In both cases the leverage is the same.
- The torque that an engine can deliver depends on the speed at which the engine is
turning, commonly expressed as rpm (revolutions per minute). The relationship
torque versus rpm is not a linear relationship, but is usually provided as a curve
known as a torque curve (the exact shape and height of the curve is specific for
each engine type, it is determined by engine tests).
- This torque will oppose the torque delivered by the engine to that wheel (which
we called the drive torque). If the brake is applied this will cause a torque as
well. For the brake, I'll assume it delivers a constant torque in the direction
opposite to the wheel' s rotation. Take care of the direction, or you won't be able
to brake when you're reversing.
7. Friction
- Friction is a crucial aspect of simulating realistic car physics in a 2D game.
- It determines how much the car's tires grip the road, affecting acceleration,
deceleration, and handling. In Unity, friction is primarily managed through Physics
Material 2D.
- the friction between the wheels and the brake pads that causes the wheels to slow
down