-
Notifications
You must be signed in to change notification settings - Fork 461
fix: Lerp smoothing frame rate dependence and freeze at maximum interpolation time #4130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop-2.0.0
Are you sure you want to change the base?
Changes from all commits
ae6b056
2e10fe5
ca064ed
3c1dc9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1136,7 +1136,7 @@ public enum InterpolationTypes | |
| /// Uses a 1 to 2 phase interpolation approach where:<br /> | ||
| /// <list type="bullet"> | ||
| /// <item><description>The first phase lerps from the previous state update value to the next state update value.</description></item> | ||
| /// <item><description>The second phase (optional) performs lerp smoothing where the current respective transform value is lerped towards the result of the first phase at a rate of 1.0 minus the respective maximum interpolation time.</description></item> | ||
| /// <item><description>The second phase (optional) performs lerp smoothing where the current respective transform value is lerped towards the result of the first phase at a frame rate independent rate determined by the respective maximum interpolation time.</description></item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <remarks> | ||
|
|
@@ -1156,7 +1156,7 @@ public enum InterpolationTypes | |
| /// Uses a 1 to 2 phase smooth dampening approach where:<br /> | ||
| /// <list type="bullet"> | ||
| /// <item><description>The first phase smooth dampens towards the current tick state update being processed by the accumulated delta time relative to the time to target.</description></item> | ||
| /// <item><description>The second phase (optional) performs lerp smoothing where the current respective transform value is lerped towards the result of the first phase at a rate of delta time divided by the respective max interpolation time.</description></item> | ||
| /// <item><description>The second phase (optional) performs lerp smoothing where the current respective transform value is lerped towards the result of the first phase at a frame rate independent rate determined by the respective maximum interpolation time.</description></item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <remarks> | ||
|
|
@@ -1236,7 +1236,10 @@ public enum InterpolationTypes | |
| /// Controls position interpolation smoothing. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// When enabled, the <see cref="BufferedLinearInterpolator{T}"/> will apply a final lerping pass where the "t" parameter is calculated by dividing the frame time divided by the <see cref="PositionMaxInterpolationTime"/>. | ||
| /// When enabled, the <see cref="BufferedLinearInterpolator{T}"/> will apply a final lerping pass towards | ||
| /// the interpolated result at a rate determined by <see cref="PositionMaxInterpolationTime"/>.<br /> | ||
| /// This is frame rate independent for all <see cref="InterpolationTypes"/>, but the same value will not | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🤖 Helpful? 👍/👎 |
||
| /// produce the same result under <see cref="InterpolationTypes.LegacyLerp"/> as it does under the others. | ||
| /// </remarks> | ||
| public bool PositionLerpSmoothing = true; | ||
| private bool m_PreviousPositionLerpSmoothing; | ||
|
|
@@ -1257,7 +1260,10 @@ public enum InterpolationTypes | |
| /// Controls rotation interpolation smoothing. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// When enabled, the <see cref="BufferedLinearInterpolator{T}"/> will apply a final lerping pass where the "t" parameter is calculated by dividing the frame time divided by the <see cref="RotationMaxInterpolationTime"/>. | ||
| /// When enabled, the <see cref="BufferedLinearInterpolator{T}"/> will apply a final lerping pass towards | ||
| /// the interpolated result at a rate determined by <see cref="RotationMaxInterpolationTime"/>.<br /> | ||
| /// This is frame rate independent for all <see cref="InterpolationTypes"/>, but the same value will not | ||
| /// produce the same result under <see cref="InterpolationTypes.LegacyLerp"/> as it does under the others. | ||
| /// </remarks> | ||
| public bool RotationLerpSmoothing = true; | ||
| private bool m_PreviousRotationLerpSmoothing; | ||
|
|
@@ -1278,7 +1284,10 @@ public enum InterpolationTypes | |
| /// Controls scale interpolation smoothing. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// When enabled, the <see cref="BufferedLinearInterpolator{T}"/> will apply a final lerping pass where the "t" parameter is calculated by dividing the frame time divided by the <see cref="ScaleMaxInterpolationTime"/>. | ||
| /// When enabled, the <see cref="BufferedLinearInterpolator{T}"/> will apply a final lerping pass towards | ||
| /// the interpolated result at a rate determined by <see cref="ScaleMaxInterpolationTime"/>.<br /> | ||
| /// This is frame rate independent for all <see cref="InterpolationTypes"/>, but the same value will not | ||
| /// produce the same result under <see cref="InterpolationTypes.LegacyLerp"/> as it does under the others. | ||
| /// </remarks> | ||
| public bool ScaleLerpSmoothing = true; | ||
| private bool m_PreviousScaleLerpSmoothing; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caps every legal value in
(0.99, 1.0], not just the freezing endpoint. For example, aLerp/SmoothDampeningtransform configured withMaximumInterpolationTime = 0.995fnow uses the sametas0.99f(at 60 fps,0.01rather than0.005), so it becomes twice as responsive and no longer honors the documented “higher is smoother” setting. Clamp to1.0ffirst and special-case only the exact1.0fendpoint (or otherwise preserve values below it).🤖 Helpful? 👍/👎