Assuming i know the geometry and the rotation angle of a cart, how can i calculate the rotation angle of a swiveling wheel?
To get the rotation angle of the wheel, i tried by calculating the distance from the rotation axis, and to apply a friction coefficient:
var dx = cartCX - wheelCX, dy = cartCY - wheelCY, dist = Math.sqrt(cartCX * wheelCX + cartCY * wheelCY); var wheelRotation = Math.atan2(-dy, -dx) * dist * friction;
But all this has not brought me any acceptable result.
Which is a simple way to get the wheels rotation angle about the Y axis when the cart is rotating?
I don't need exact physics simulation, just a smooth rotation angle which i can tween. I think there should be no need to use any physics engine, or i'm wrong?