This commit is contained in:
vis2k 2023-03-08 10:35:55 +08:00
parent 73f374e35c
commit 4f1751f725
2 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,9 @@ public static partial class NetworkClient
// behind this 2 buffer target, leaving the rest of the drift to be
// dealt with by catch up.
//
// to reproduce, use the SnapshotInterpolation demo and minimize the
// Editor for a while. after coming back, it'll be behind a lot.
//
// Target time for sync = client/server time - buffer time.
// Time difference = latest time snapshot time - buffer time
// If time difference > clampingBufferMultiplier(below) * buffer time, we clamp it to within

View File

@ -117,6 +117,9 @@ public static bool InsertIfNotExists<T>(
// Also, we don't snap to exactly 2 buffer behind, we snap to somewhere
// behind this 2 buffer target, leaving the rest of the drift to be
// dealt with by catch up.
//
// to reproduce, use the SnapshotInterpolation demo and minimize the
// Editor for a while. after coming back, it'll be behind a lot.
public static void TimelineOverride(double latestRemoteTime, double bufferTime, float clampMultiplier, ref double localTimeline)
{
// If we want local timeline to be around bufferTime slower,