added mathx.identity for use as a default easing function without a branch

This commit is contained in:
Max Cahill 2023-11-23 16:16:15 +11:00
parent 6fa0b31455
commit 1b396037a2

View File

@ -95,6 +95,11 @@ end
--easing curves
--(generally only "safe" for 0-1 range, see mathx.clamp01)
--no curve - can be used as a default to avoid needing a branch
function mathx.identity(f)
return f
end
--classic smoothstep
function mathx.smoothstep(f)
return f * f * (3 - 2 * f)