local t={}t.__index=t t.CameraShakeState={FadingIn=0;FadingOut=1,Sustained=2,Inactive=3}local f=Vector3.new function t.new(h,x,g,W)if g==nil then g=0 end if W==nil then W=0 end assert(type(h)=="\110\117\109\098\101\114","\077\097\103\110\105\116\117\100\101 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114")assert(type(x)=="\110\117\109\098\101\114","\082\111\117\103\104\110\101\115\115 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114")assert(type(g)=="\110\117\109\098\101\114","\070\097\100\101\073\110\084\105\109\101 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114")assert(type(W)=="\110\117\109\098\101\114","\070\097\100\101\079\117\116\084\105\109\101 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114")local a={Magnitude=h,Roughness=x;PositionInfluence=f();RotationInfluence=f(),DeleteOnInactive=true,roughMod=1;magnMod=1;fadeOutDuration=W;fadeInDuration=g;sustain=g>0}local U if g>0 then U=0 else U=1 end a.currentFadeTime=U a.tick=(Random.new()):NextNumber(-100,100)a._camShakeInstance=true return setmetatable(a,t)end local h=math.noise function t.UpdateShake(t,x)local g=t.tick local W=t.currentFadeTime if t.fadeInDuration>0 and t.sustain then if W<1 then W=W+x/t.fadeInDuration elseif t.fadeOutDuration>0 then t.sustain=false end end if not t.sustain then W=W-x/t.fadeOutDuration end if t.sustain then t.tick=g+(x*t.Roughness)*t.roughMod else t.tick=g+((x*t.Roughness)*t.roughMod)*W end t.currentFadeTime=W return((f(h(g,0)*.5,h(0,g)*.5,h(g,g)*.5)*t.Magnitude)*t.magnMod)*W end function t.StartFadeOut(t,f)if f==0 then t.currentFadeTime=0 end t.fadeOutDuration=f t.fadeInDuration=0 t.sustain=false end function t.StartFadeIn(t,f)if f==0 then t.currentFadeTime=1 end t.fadeInDuration=f or t.fadeInDuration t.fadeOutDuration=0 t.sustain=true end function t.GetScaleRoughness(t)return t.roughMod end function t.SetScaleRoughness(t,f)t.roughMod=f end function t.GetScaleMagnitude(t)return t.magnMod end function t.SetScaleMagnitude(t,f)t.magnMod=f end function t.GetNormalizedFadeTime(t)return t.currentFadeTime end function t.IsShaking(t)local f=true if not(t.currentFadeTime>0)then f=t.sustain end return f end function t.IsFadingOut(t)return not t.sustain and t.currentFadeTime>0 end function t.IsFadingIn(t)local f=false if t.currentFadeTime<1 then f=t.sustain and t.fadeInDuration>0 end return f end function t.GetState(f)if f:IsFadingIn()then return t.CameraShakeState.FadingIn end if f:IsFadingOut()then return t.CameraShakeState.FadingOut end if f:IsShaking()then return t.CameraShakeState.Sustained end return t.CameraShakeState.Inactive end return t


local v1 = {};
v1.__index = v1;
v1.CameraShakeState = {
	FadingIn = 0, 
	FadingOut = 1, 
	Sustained = 2, 
	Inactive = 3
};
local l__Vector3_new__1 = Vector3.new;
function v1.new(p1, p2, p3, p4)
	if p3 == nil then
		p3 = 0;
	end;
	if p4 == nil then
		p4 = 0;
	end;
	assert(type(p1) == "number", "Magnitude must be a number");
	assert(type(p2) == "number", "Roughness must be a number");
	assert(type(p3) == "number", "FadeInTime must be a number");
	assert(type(p4) == "number", "FadeOutTime must be a number");
	local v2 = {
		Magnitude = p1, 
		Roughness = p2, 
		PositionInfluence = l__Vector3_new__1(), 
		RotationInfluence = l__Vector3_new__1(), 
		DeleteOnInactive = true, 
		roughMod = 1, 
		magnMod = 1, 
		fadeOutDuration = p4, 
		fadeInDuration = p3, 
		sustain = p3 > 0
	};
	local v3
	if p3 > 0 then
		v3 = 0;
	else
		v3 = 1;
	end;
	v2.currentFadeTime = v3;
	v2.tick = Random.new():NextNumber(-100, 100);
	v2._camShakeInstance = true;
	return setmetatable(v2, v1);
end;
local l__math_noise__2 = math.noise;
function v1.UpdateShake(p5, p6)
	local l__tick__4 = p5.tick;
	local v5 = p5.currentFadeTime;
	if p5.fadeInDuration > 0 and p5.sustain then
		if v5 < 1 then
			v5 = v5 + p6 / p5.fadeInDuration;
		elseif p5.fadeOutDuration > 0 then
			p5.sustain = false;
		end;
	end;
	if not p5.sustain then
		v5 = v5 - p6 / p5.fadeOutDuration;
	end;
	if p5.sustain then
		p5.tick = l__tick__4 + p6 * p5.Roughness * p5.roughMod;
	else
		p5.tick = l__tick__4 + p6 * p5.Roughness * p5.roughMod * v5;
	end;
	p5.currentFadeTime = v5;
	return l__Vector3_new__1(l__math_noise__2(l__tick__4, 0) * 0.5, l__math_noise__2(0, l__tick__4) * 0.5, l__math_noise__2(l__tick__4, l__tick__4) * 0.5) * p5.Magnitude * p5.magnMod * v5;
end;
function v1.StartFadeOut(p7, p8)
	if p8 == 0 then
		p7.currentFadeTime = 0;
	end;
	p7.fadeOutDuration = p8;
	p7.fadeInDuration = 0;
	p7.sustain = false;
end;
function v1.StartFadeIn(p9, p10)
	if p10 == 0 then
		p9.currentFadeTime = 1;
	end;
	p9.fadeInDuration = p10 or p9.fadeInDuration;
	p9.fadeOutDuration = 0;
	p9.sustain = true;
end;
function v1.GetScaleRoughness(p11)
	return p11.roughMod;
end;
function v1.SetScaleRoughness(p12, p13)
	p12.roughMod = p13;
end;
function v1.GetScaleMagnitude(p14)
	return p14.magnMod;
end;
function v1.SetScaleMagnitude(p15, p16)
	p15.magnMod = p16;
end;
function v1.GetNormalizedFadeTime(p17)
	return p17.currentFadeTime;
end;
function v1.IsShaking(p18)
	local v6 = true;
	if not (p18.currentFadeTime > 0) then
		v6 = p18.sustain;
	end;
	return v6;
end;
function v1.IsFadingOut(p19)
	return not p19.sustain and p19.currentFadeTime > 0;
end;
function v1.IsFadingIn(p20)
	local v7 = false;
	if p20.currentFadeTime < 1 then
		v7 = p20.sustain and p20.fadeInDuration > 0;
	end;
	return v7;
end;
function v1.GetState(p21)
	if p21:IsFadingIn() then
		return v1.CameraShakeState.FadingIn;
	end;
	if p21:IsFadingOut() then
		return v1.CameraShakeState.FadingOut;
	end;
	if p21:IsShaking() then
		return v1.CameraShakeState.Sustained;
	end;
	return v1.CameraShakeState.Inactive;
end;
return v1;
