public void QueuePosition(uint ms, Vector3 pos) { uint lastMs = 0; if (posBuffer.Count > 0) { lastMs = posBuffer.Peek().Tick; } receivedPosTime += SeqDiff(ms, lastMs); if (posBuffer.Count == posBuffer.Capacity) { FLLog.Warning("Net", "Something bad happened lerp pos"); receivedPosTime = 0; posBuffer.Clear(); } posBuffer.Enqueue(new PosState() { Tick = ms, Pos = pos }); }
public void QueueOrientation(uint ms, Quaternion orient) { uint lastMs = 0; if (orientBuffer.Count > 0) { lastMs = orientBuffer.Peek().Tick; } receivedOrientTime += SeqDiff(ms, lastMs); if (orientBuffer.Count == orientBuffer.Capacity) { FLLog.Warning("Net", "Something bad happened lerp orient"); receivedOrientTime = 0; orientBuffer.Clear(); } orientBuffer.Enqueue(new OrientState() { Tick = ms, Orient = orient }); }