Merge pull request #19756 from NathanWarden/mono_lerp_fixes

[C#] Lerp now consistent with Godot API. InverseLerp fixed.
This commit is contained in:
Ignacio Etcheverry 2018-07-04 21:23:50 +02:00 committed by GitHub
commit 769f172602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ namespace Godot
public static real_t InverseLerp(real_t from, real_t to, real_t weight)
{
return (Clamp(weight, 0f, 1f) - from) / (to - from);
return (weight - from) / (to - from);
}
public static bool IsInf(real_t s)
@ -165,7 +165,7 @@ namespace Godot
public static real_t Lerp(real_t from, real_t to, real_t weight)
{
return from + (to - from) * Clamp(weight, 0f, 1f);
return from + (to - from) * weight;
}
public static real_t Log(real_t s)