mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Removed "len" argument from lume.pingpong()
This commit is contained in:
parent
02cdf32bdd
commit
3eec98906b
@ -33,8 +33,8 @@ range of 0 - 1; if `amount` is outside of this range it is clamped.
|
|||||||
Similar to `lume.lerp()` but uses cosine interpolation instead of linear
|
Similar to `lume.lerp()` but uses cosine interpolation instead of linear
|
||||||
interpolation.
|
interpolation.
|
||||||
|
|
||||||
### lume.pingpong(x, len)
|
### lume.pingpong(x)
|
||||||
Ping-pongs the value `x` between 0 and `len`.
|
Ping-pongs the value `x` between 0 and 1.
|
||||||
|
|
||||||
### lume.distance(x1, y1, x2, y2)
|
### lume.distance(x1, y1, x2, y2)
|
||||||
Returns the distance between the two points.
|
Returns the distance between the two points.
|
||||||
|
6
lume.lua
6
lume.lua
@ -7,7 +7,7 @@
|
|||||||
-- under the terms of the MIT license. See LICENSE for details.
|
-- under the terms of the MIT license. See LICENSE for details.
|
||||||
--
|
--
|
||||||
|
|
||||||
local lume = { _version = "1.0.1" }
|
local lume = { _version = "1.0.2" }
|
||||||
|
|
||||||
|
|
||||||
function lume.clamp(x, min, max)
|
function lume.clamp(x, min, max)
|
||||||
@ -36,8 +36,8 @@ function lume.smooth(a, b, amount)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function lume.pingpong(x, len)
|
function lume.pingpong(x)
|
||||||
return (1 - math.abs(1 - x % 2)) * (len or 1)
|
return 1 - math.abs(1 - x % 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user