As I saw someone else working with raycast cars, I want to know if my steering force calculus is right:
- Code: Select all
yaw = mass * forwardSpeed * sin(steering * 3.14 / 180) * (frontTirePos.m_z - CenterOfMass.m_z)
The logic for this is (I think) that mass * forwardSpeed is the force that moves the car forward.
sin(steering * 3.14/180) is the sin of the angle between front wheels and ground.
(frontTirePos.m_z - CenterOfMass.m_z) is the distance between front axel and center of mass of the car
So, the forward force times the sin of steering is the lateral component of the force.
lateral component of the force times the distance from front to center results in the rotation torque, right?
Of course, is not considerating the grip forces of the car, but this is right?