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
{{ message }}
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
Call BeardedMath.Lerp(1, 2, 1), but the original value is always returned.
Context
This may not pose a problem in practice most of the time, because float and double have specific overrides that do work. The generic implementation however always returns a0, which means that the promise of a1 being returned when t = 1 never holds true.
If lerping is not supported for a type, the generic implementation should probably always return a1 instead, immediately reaching the destination. Otherwise, interpolating values gradually over the network will keep trying to get closer to the destination value in YourGeneratedNetworkObject.InterpolateUpdate, but will never reach its destination.
I encountered this for Float3 and Float4 in #310, but noticed this behavior also exists on master and develop, hence this report.
(It is not clear to me how lerping currently works for Unity's Vector3 and friends, as it's not handled here either, but IsInterpolatable claims it is supposedly interpolatable. EDIT: Nevermind, it's InterpolateVector3 and friends.)
The text was updated successfully, but these errors were encountered:
Version Number and Operating System(s):
Windows 10, Forge Network Alloy at da8e129 (but the same problem appears to exist in Remastered).
Expected behavior:
BeardedMath.Lerp
with some generic type, such asint
, eventually reaches the target.Actual behavior:
The target is never reached.
Steps to reproduce:
Call
BeardedMath.Lerp(1, 2, 1)
, but the original value is always returned.Context
This may not pose a problem in practice most of the time, because
float
anddouble
have specific overrides that do work. The generic implementation however always returnsa0
, which means that the promise ofa1
being returned whent = 1
never holdstrue
.If lerping is not supported for a type, the generic implementation should probably always return
a1
instead, immediately reaching the destination. Otherwise, interpolating values gradually over the network will keep trying to get closer to the destination value inYourGeneratedNetworkObject.InterpolateUpdate
, but will never reach its destination.I encountered this for
Float3
andFloat4
in #310, but noticed this behavior also exists onmaster
anddevelop
, hence this report.(It is not clear to me how lerping currently works for Unity's
Vector3
and friends, as it's not handled here either, butIsInterpolatable
claims it is supposedly interpolatable. EDIT: Nevermind, it'sInterpolateVector3
and friends.)The text was updated successfully, but these errors were encountered: