mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 06:04:35 +00:00
added mathx.identity for use as a default easing function without a branch
This commit is contained in:
parent
6fa0b31455
commit
1b396037a2
@ -95,6 +95,11 @@ end
|
|||||||
--easing curves
|
--easing curves
|
||||||
--(generally only "safe" for 0-1 range, see mathx.clamp01)
|
--(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
|
--classic smoothstep
|
||||||
function mathx.smoothstep(f)
|
function mathx.smoothstep(f)
|
||||||
return f * f * (3 - 2 * f)
|
return f * f * (3 - 2 * f)
|
||||||
|
Loading…
Reference in New Issue
Block a user