Skip to content

Commit 29f5e46

Browse files
fix
Fixing a mistake on SD final lerp pass.
1 parent 55a0e87 commit 29f5e46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,9 @@ internal T Update(float deltaTime, double tickLatencyAsTime, double minDeltaTime
442442
//InterpolateState.PreviousValue = SmoothDamp(InterpolateState.PreviousValue, InterpolateState.Target.Value.Item, ref m_RateOfChange, (float)InterpolateState.TimeToTargetValue, (float)InterpolateState.DeltaTime);
443443
//var predictedTime = InterpolateState.PredictingNext ? InterpolateState.DeltaTime : Math.Min(InterpolateState.TimeToTargetValue, InterpolateState.DeltaTime + InterpolateState.AverageDeltaTime);
444444
//InterpolateState.PredictValue = SmoothDamp(InterpolateState.PredictValue, InterpolateState.PredictTarget, ref m_PredictedRateOfChange, (float)InterpolateState.TimeToTargetValue, (float)predictedTime);
445-
InterpolateState.Phase1Value = SmoothDamp(InterpolateState.CurrentValue, InterpolateState.Target.Value.Item, ref m_RateOfChange, (float)InterpolateState.TimeToTargetValue, (float)InterpolateState.DeltaTime);
445+
InterpolateState.PreviousValue = SmoothDamp(InterpolateState.CurrentValue, InterpolateState.Target.Value.Item, ref m_RateOfChange, (float)InterpolateState.TimeToTargetValue, (float)InterpolateState.DeltaTime);
446446
var predictedTime = InterpolateState.PredictingNext ? InterpolateState.DeltaTime : Math.Min(InterpolateState.TimeToTargetValue, InterpolateState.DeltaTime + InterpolateState.AverageDeltaTime);
447-
InterpolateState.PredictValue = SmoothDamp(InterpolateState.Phase1Value, InterpolateState.Target.Value.Item, ref m_PredictedRateOfChange, (float)InterpolateState.TimeToTargetValue, (float)predictedTime);
447+
InterpolateState.PredictValue = SmoothDamp(InterpolateState.PreviousValue, InterpolateState.Target.Value.Item, ref m_PredictedRateOfChange, (float)InterpolateState.TimeToTargetValue, (float)predictedTime);
448448
// Determine if smooth dampening is enabled to get our lerp "t" time
449449
var timeDelta = lerpSmoothing ? deltaTime / MaximumInterpolationTime : deltaTime;
450450
// Lerp between the PreviousValue and PredictedValue using the calculated time delta

0 commit comments

Comments
 (0)