Learning how to implement simple car control calculating the physics from scratch.
Implemented using: C++, Unreal Engine
A simple car simulation for learning how to implement rudimentary physics. The real time data of the user input (throttle and steering) is then used to calculate final velocity and rotation of the car.
Forward / Reverse
- Maximum Drive Force of the simulated engine.
- Drag Coefficient of the object.
- Rolling Resistance Coefficient of the object.
- Mass of the object.
Drive Force - The force applied to the object by the simulated engine.
Air Resistance - The force applied to the object from drag in the opposite direction of the drive force.
Rolling Resistance - Force applies to the object by gravity and the friction of the object and contact surface.
Acceleration - The force applied to the object taking in to account the parameters and law of motion.
Final Velocity - The current velocity of the object in the current time slice.
Distance Delta - The distance the object will move in this time slice
- Because the speed (magnitude of the velocity) will always be 0 or greater, we use the dot product of the velocity and the car’s forward vector which will return less than 0 if car is reversing
Rotation Angle - The angle the object rotates around the z axis.