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
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -134,10 +134,15 @@ public void Reset(T currentValue)
134
134
135
135
privateconstdoublek_SmallValue=9.999999439624929E-11;// copied from Vector3's equal operator
136
136
137
-
138
137
/// <summary>
139
-
/// 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.
138
+
/// Determines how much smoothing will be applied to the 2nd lerp when using the <see cref="Update(float, double, double)"/> (i.e. lerping and not smooth dampening).
140
139
/// </summary>
140
+
/// <remarks>
141
+
/// There's two factors affecting interpolation: <br />
142
+
/// - Buffering: Which can be adjusted in set in the <see cref="NetworkManager.NetworkTimeSystem"/>.<br />
143
+
/// - Interpolation time: The divisor applied to delta time where the quotient is used as the lerp time.
144
+
/// </remarks>
145
+
[Range(0.016f,1.0f)]
141
146
publicfloatMaximumInterpolationTime=0.1f;
142
147
143
148
/// <summary>
@@ -435,7 +440,10 @@ public T Update(float deltaTime, double renderTime, double serverTime)
/// Uses a smooth dampening approach and is recommended when <see cref="NetworkRigidbodyBase.UseRigidBodyForMotion"/> is enabled.
955
+
/// Uses a smooth dampening approach for interpolating between two data points and adjusts based on rate of change.
950
956
/// </summary>
957
+
/// <remarks>
958
+
/// Unlike <see cref="Lerp"/>, there are no additional values needed to be adjusted for this interpolation type.
959
+
/// </remarks>
951
960
SmoothDampening
952
961
}
953
962
954
963
/// <summary>
955
964
/// The position interpolation type to use for the <see cref="NetworkTransform"/> instance.
956
965
/// </summary>
957
966
/// <remarks>
958
-
/// For more details review <see cref="InterpolationTypes"/>.
967
+
/// - <see cref="InterpolationTypes.Lerp"/> yields a traditional linear result.<br />
968
+
/// - <see cref="InterpolationTypes.SmoothDampening"/> adjusts based on the rate of change.<br />
969
+
/// - You can have mixed interpolation types between position, rotation, and scale on the same <see cref="NetworkTransform"/> instance.<br />
970
+
/// - You can change the interpolation type during runtime, but changing between <see cref="InterpolationTypes"/> can result in a slight stutter if the object is in motion.<br />
959
971
/// </remarks>
972
+
[Tooltip("Lerping yields a traditional linear result where smooth dampening will adjust based on the rate of change. You can mix interpolation types for position, rotation, and scale.")]
/// The rotation interpolation type to use for the <see cref="NetworkTransform"/> instance.
964
977
/// </summary>
965
978
/// <remarks>
966
-
/// For more details review <see cref="InterpolationTypes"/>.
979
+
/// - <see cref="InterpolationTypes.Lerp"/> yields a traditional linear result.<br />
980
+
/// - <see cref="InterpolationTypes.SmoothDampening"/> adjusts based on the rate of change.<br />
981
+
/// - You can have mixed interpolation types between position, rotation, and scale on the same <see cref="NetworkTransform"/> instance.<br />
982
+
/// - You can change the interpolation type during runtime, but changing between <see cref="InterpolationTypes"/> can result in a slight stutter if the object is in motion.<br />
967
983
/// </remarks>
984
+
[Tooltip("Lerping yields a traditional linear result where smooth dampening will adjust based on the rate of change. You can mix interpolation types for position, rotation, and scale.")]
/// The scale interpolation type to use for the <see cref="NetworkTransform"/> instance.
972
989
/// </summary>
973
990
/// <remarks>
974
-
/// For more details review <see cref="InterpolationTypes"/>.
991
+
/// - <see cref="InterpolationTypes.Lerp"/> yields a traditional linear result.<br />
992
+
/// - <see cref="InterpolationTypes.SmoothDampening"/> adjusts based on the rate of change.<br />
993
+
/// - You can have mixed interpolation types between position, rotation, and scale on the same <see cref="NetworkTransform"/> instance.<br />
994
+
/// - You can change the interpolation type during runtime, but changing between <see cref="InterpolationTypes"/> can result in a slight stutter if the object is in motion.<br />
975
995
/// </remarks>
996
+
[Tooltip("Lerping yields a traditional linear result where smooth dampening will adjust based on the rate of change. You can mix interpolation types for position, rotation, and scale.")]
976
997
publicInterpolationTypesScaleInterpolationType;
977
998
978
999
/// <summary>
979
-
/// When <see cref="Interpolate"/> is enabled and using <see cref="InterpolationTypes.Lerp"/>, this adjust the maximum interpolation time for position.
1000
+
/// The position interoplation time divisor applied to the current delta time (dividend) where the quotient yields the time used for the second smoothing lerp.
1001
+
/// - The lower the value the smoother, but can result in lost data points (i.e. quick changes in direct). <br />
1002
+
/// - The higher the value the more accurate/precise, but can result in slight stutter (i.e. due to jitter, latency, or a high threshold value). <br />
1003
+
/// - This value can be adjusted during runtime in the event you want to dynamically adjust it based on some other value (i.e. velocity or the like).
980
1004
/// </summary>
1005
+
/// <remarks>
1006
+
/// - Only used When <see cref="Interpolate"/> is enabled and using <see cref="InterpolationTypes.Lerp"/>. <br />
1007
+
/// - The quotient will be clamped to a value that ranges from 1.0f to the current delta time (i.e. <see cref="Time.deltaTime"/> or <see cref="Time.fixedDeltaTime"/>)
1008
+
/// </remarks>
1009
+
[Tooltip("The lower the value the smoother, but can result in lost data points (i.e. quick changes in direct). The higher the value the more accurate/precise, but can result in slight stutter (i.e. due to jitter, latency, or a high threshold value).")]
1010
+
[Range(0.01f,1.0f)]
981
1011
publicfloatPositionMaxInterpolationTime=0.1f;
1012
+
982
1013
/// <summary>
983
-
/// When <see cref="Interpolate"/> is enabled and using <see cref="InterpolationTypes.Lerp"/>, this adjust the maximum interpolation time for rotation.
1014
+
/// The rotation interoplation time divisor applied to the current delta time (dividend) where the quotient yields the time used for the second smoothing lerp.
1015
+
/// - The lower the value the smoother, but can result in lost data points (i.e. quick changes in direct). <br />
1016
+
/// - The higher the value the more accurate/precise, but can result in slight stutter (i.e. due to jitter, latency, or a high threshold value). <br />
1017
+
/// - This value can be adjusted during runtime in the event you want to dynamically adjust it based on some other value (i.e. velocity or the like).
984
1018
/// </summary>
1019
+
/// <remarks>
1020
+
/// - Only used When <see cref="Interpolate"/> is enabled and using <see cref="InterpolationTypes.Lerp"/>. <br />
1021
+
/// - The quotient will be clamped to a value that ranges from 1.0f to the current delta time (i.e. <see cref="Time.deltaTime"/> or <see cref="Time.fixedDeltaTime"/>)
1022
+
/// </remarks>
1023
+
[Tooltip("The lower the value the smoother, but can result in lost data points (i.e. quick changes in direct). The higher the value the more accurate/precise, but can result in slight stutter (i.e. due to jitter, latency, or a high threshold value).")]
1024
+
[Range(0.01f,1.0f)]
985
1025
publicfloatRotationMaxInterpolationTime=0.1f;
1026
+
986
1027
/// <summary>
987
-
/// When <see cref="Interpolate"/> is enabled and using <see cref="InterpolationTypes.Lerp"/>, this adjust the maximum interpolation time for scale.
1028
+
/// The scale interoplation time divisor applied to the current delta time (dividend) where the quotient yields the time used for the second smoothing lerp.
1029
+
/// - The lower the value the smoother, but can result in lost data points (i.e. quick changes in direct). <br />
1030
+
/// - The higher the value the more accurate/precise, but can result in slight stutter (i.e. due to jitter, latency, or a high threshold value). <br />
1031
+
/// - This value can be adjusted during runtime in the event you want to dynamically adjust it based on some other value (i.e. velocity or the like).
988
1032
/// </summary>
1033
+
/// <remarks>
1034
+
/// - Only used When <see cref="Interpolate"/> is enabled and using <see cref="InterpolationTypes.Lerp"/>. <br />
1035
+
/// - The quotient will be clamped to a value that ranges from 1.0f to the current delta time (i.e. <see cref="Time.deltaTime"/> or <see cref="Time.fixedDeltaTime"/>)
1036
+
/// </remarks>
1037
+
[Tooltip("The lower the value the smoother, but can result in lost data points (i.e. quick changes in direct). The higher the value the more accurate/precise, but can result in slight stutter (i.e. due to jitter, latency, or a high threshold value).")]
0 commit comments