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 as int, 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 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.)
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.Lerpwith 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
floatanddoublehave specific overrides that do work. The generic implementation however always returnsa0, which means that the promise ofa1being returned whent = 1never holdstrue.If lerping is not supported for a type, the generic implementation should probably always return
a1instead, 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
Float3andFloat4in #310, but noticed this behavior also exists onmasteranddevelop, hence this report.(It is not clear to me how lerping currently works for Unity's
Vector3and friends, as it's not handled here either, butIsInterpolatableclaims it is supposedly interpolatable. EDIT: Nevermind, it'sInterpolateVector3and friends.)