Hi I trying to simulate a vehicle turning around a radius. This is what I'm currently doing
- Calculate the radius of the turn.
- Calculate acceleration and add to velocity
- Use velocity magnitude to determine distance travelled in one update
- Use arctan( distanceTraveled / turnRadius ) to get the angle of rotation
- Update vehicle angle
- Rotate velocity by vehicle angle. e.g. velocity *= Quaternion.AngleAxis(angle, Vector3.up)
- Update vehicle position with velocity
I'm currently getting a lot of drift and not driving straight. Any ideas how to correctly implement this.