Skip to content

Commit

Permalink
added mathx.identity for use as a default easing function without a b…
Browse files Browse the repository at this point in the history
…ranch
  • Loading branch information
1bardesign committed Nov 23, 2023
1 parent 6fa0b31 commit 1b39603
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mathx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b39603

Please sign in to comment.