You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,6 +22,10 @@ public BufferedItem(T item, double timeSent)
24
22
}
25
23
}
26
24
25
+
/// <summary>
26
+
/// There’s two factors affecting interpolation: buffering (set in NetworkManager’s NetworkTimeSystem) and interpolation time, which is the amount of time it’ll take to reach the target. This is to affect the second one.
27
+
/// </summary>
28
+
publicfloatMaximumInterpolationTime=0.1f;
27
29
28
30
privateconstdoublek_SmallValue=9.999999439624929E-11;// copied from Vector3's equal operator
29
31
@@ -69,13 +71,19 @@ public BufferedItem(T item, double timeSent)
/// Teleports current interpolation value to targetValue.
86
+
/// </summary>
79
87
publicvoidResetTo(TtargetValue,doubleserverTime)
80
88
{
81
89
m_LifetimeConsumedCount=1;
@@ -89,7 +97,6 @@ public void ResetTo(T targetValue, double serverTime)
89
97
Update(0,serverTime,serverTime);
90
98
}
91
99
92
-
93
100
// todo if I have value 1, 2, 3 and I'm treating 1 to 3, I shouldn't interpolate between 1 and 3, I should interpolate from 1 to 2, then from 2 to 3 to get the best path
m_CurrentInterpValue=Interpolate(m_CurrentInterpValue,target,deltaTime/maxInterpTime);// second interpolate to smooth out extrapolation jumps
215
+
m_CurrentInterpValue=Interpolate(m_CurrentInterpValue,target,deltaTime/MaximumInterpolationTime);// second interpolate to smooth out extrapolation jumps
210
216
}
211
217
212
218
m_NbItemsReceivedThisFrame=0;
213
219
returnm_CurrentInterpValue;
214
220
}
215
221
222
+
/// <summary>
223
+
/// Add measurements to be used during interpolation. These will be buffered before being made available to be displayed as "latest value".
0 commit comments