Add math function for animation

This commit is contained in:
NullBite 2022-03-23 21:31:27 -04:00
parent f0fa8ef459
commit 3c21c6c581
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -201,6 +201,14 @@ function recurseModelGroup(group)
end
-- }}}
-- Math {{{
--- Sine function with period and amplitude
--- @param x number Input value
--- @param period number Period of sine wave
--- @param amp number Peak amplitude of sine wave
function wave(x, period, amp) return math.sin((2/period)*math.pi*(x%period))*amp end
-- }}}
-- master state variables and configuration (do not access within pings) -- {{{
if client.isHost() then
local defaults={