1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00

Fix invlerp method

This commit is contained in:
Grégoire Ciles
2023-11-29 12:27:01 +01:00
parent 65c486b910
commit f2898c8c8e

View File

@@ -28,7 +28,7 @@ const lerp = (x, y, a) => x * (1 - a) + y * a
* @return {number} inverted lerp value
*/
const invlerp = (x, y, a) => clamp((v - x)/(a - x))
const invlerp = (x, y, a) => clamp((a - x)/(y - x))
/**