My multiplayer game currently has a packet being delivered every 100ms.
The packet contains position and a heading angle which is -pi to pi.
I am actually rendering 100ms behind real server time in order to be able to lerp the positions (which work fine). I tried to lerp the heading angle this way and it works but theres a sudden snapback at the end of every rotation. I just cant figure out what it could be
//lerp:
//return a + (b - a) * t;
float h1 = (*ito).headings.front(); //Heading 100ms agofloat h2 = (*ito).headings.back(); //Current server headingfloat currh = 0.0f; //Lerped headingcurrh = Math::lerp(h1, h2, zlerp);//zlerp = elapsed time since last update / 100.0 (ms) This works perfect for pos
Anyone could know what im doing wrong?