summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2018-07-04 21:23:50 +0200
committerGitHub <noreply@github.com>2018-07-04 21:23:50 +0200
commit769f172602ebaac9afb8cf8e5761b7665f8666d5 (patch)
tree3c73bf5aac9fa35b3b15dac5f703299b46b1a519
parentf8daa080f297523d641f176d9b07b7d85fb0f772 (diff)
parentc2315e3291d2ae264a49c1ee30ea9b024d2d0427 (diff)
Merge pull request #19756 from NathanWarden/mono_lerp_fixes
[C#] Lerp now consistent with Godot API. InverseLerp fixed.
-rw-r--r--modules/mono/glue/cs_files/Mathf.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/glue/cs_files/Mathf.cs b/modules/mono/glue/cs_files/Mathf.cs
index 0d20a12563..1ed2889833 100644
--- a/modules/mono/glue/cs_files/Mathf.cs
+++ b/modules/mono/glue/cs_files/Mathf.cs
@@ -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)