From 431dd26a6159a1a9d62fc41d6bbbbfac0b7717cd Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Fri, 7 Jul 2023 01:33:27 -0400 Subject: [PATCH] Added lerp to math scripting module --- Editor/resources/Scripts/Math.wren | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Editor/resources/Scripts/Math.wren b/Editor/resources/Scripts/Math.wren index c0b0818f..0d801f0c 100644 --- a/Editor/resources/Scripts/Math.wren +++ b/Editor/resources/Scripts/Math.wren @@ -14,6 +14,10 @@ class Math { return this.Dot_(vec1.x, vec1.y, vec1.z, vec2.x, vec2.y, vec2.z) } + static Lerp(a, b, t) { + return a + t * (b - a) + } + foreign static Dot_(x, y, z, x1, y2, z2) foreign static Cross_(x, y, z, x1, y2, z2) foreign static Length_(x, y, z)