mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-15 22:01:54 +00:00
More camera, might deprecate the custom camera
This commit is contained in:
30
src/shared/AlgebraEasings.lua
Normal file
30
src/shared/AlgebraEasings.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
--My versions
|
||||
|
||||
type EaseFunction = (n: number) -> number
|
||||
|
||||
export type EasingStyles = {
|
||||
Linear: EaseFunction,
|
||||
InOutBack: EaseFunction,
|
||||
OutBounce: EaseFunction
|
||||
}
|
||||
|
||||
local Ease: EasingStyles = {}
|
||||
--Google straight up gives wrong/bad math
|
||||
|
||||
function Ease.Linear(a,b,t)
|
||||
return a-a*t+b*t
|
||||
end
|
||||
|
||||
local c = 2.59491
|
||||
function Ease.InOutBack(n)
|
||||
return n<.5 and 2*n*n*(-c+2*n+2*c*n) or 3*(-1+n)*(-1+n)*(-2-c+2*n+2*c*n)
|
||||
end
|
||||
|
||||
local n1, d1 = 7.5625, 2.75
|
||||
function Ease.OutBounce(n)
|
||||
return (n<0.363636 and n*n*n1 or
|
||||
n<0.727273 and (.75*(1.*d1-2.*n*n1)) or
|
||||
n<0.909091 and (.9375*(1.*d1-2.4*n*n1)/d1)) or (.984375*(1.*d1-2.66667*n*n1))/d1
|
||||
end
|
||||
|
||||
return Ease
|
||||
Reference in New Issue
Block a user