Skip to content

Commit 354b036

Browse files
update
Fixing some xml api text issues. Making sure we are clearing the interpolator when reaching the maximum boundary.
1 parent 4121985 commit 354b036

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public void Clear()
201201
}
202202

203203
/// <summary>
204-
/// Resets the current interpolator to the target valueTeleports current interpolation value to targetValue.
204+
/// Resets the current interpolator to the target value.
205205
/// </summary>
206206
/// <remarks>
207207
/// This is used when first synchronizing/initializing and when telporting an object.
@@ -308,7 +308,7 @@ private void TryConsumeFromBuffer(double renderTime, float minDeltaTime, float m
308308
/// Interpolation Update to use when smooth dampening is enabled on a <see cref="Components.NetworkTransform"/>.
309309
/// </summary>
310310
/// <remarks>
311-
/// Alternate recommended interpolation when when <see cref="Components.NetworkRigidbodyBase.UseRigidBodyForMotion"/> is enabled.<br />
311+
/// Alternate recommended interpolation when <see cref="Components.NetworkRigidbodyBase.UseRigidBodyForMotion"/> is enabled.<br />
312312
/// This can provide a precise interpolation result between the current and target values at the expense of not being as smooth as then doulbe Lerp approach.
313313
/// </remarks>
314314
/// <param name="deltaTime">The last frame time that is either <see cref="Time.deltaTime"/> for non-rigidbody motion and <see cref="Time.fixedDeltaTime"/> when using ridigbody motion.</param>
@@ -487,6 +487,9 @@ public void AddMeasurement(T newMeasurement, double sentTime)
487487
{
488488
if (m_LastBufferedItemReceived.TimeSent < sentTime)
489489
{
490+
// Clear the interpolator
491+
Clear();
492+
// Reset to the new value
490493
InternalReset(newMeasurement, sentTime, IsAngularValue, false);
491494
m_LastMeasurementAddedTime = sentTime;
492495
m_LastBufferedItemReceived = new BufferedItem(newMeasurement, sentTime, m_BufferCount);

0 commit comments

Comments
 (0)