local J=math.rad(80)local s=math.rad(0)local q=require(script.Parent:WaitForChild("\066\097\115\101\067\097\109\101\114\097"))local d=require(script.Parent:WaitForChild("\067\097\109\101\114\097\073\110\112\117\116"))local Y=require(script.Parent:WaitForChild("\067\097\109\101\114\097\085\116\105\108\115"))local V=require(script.Parent:WaitForChild("\090\111\111\109\067\111\110\116\114\111\108\108\101\114"))local g=require(script:WaitForChild("\086\101\104\105\099\108\101\067\097\109\101\114\097\067\111\114\101"))local w=require(script:WaitForChild("\086\101\104\105\099\108\101\067\097\109\101\114\097\067\111\110\102\105\103"))local n=(game:GetService("\080\108\097\121\101\114\115")).LocalPlayer local A=Y.map local U=.016666666666667;(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Stepped:Connect(function(J,s)U=s end)local I=setmetatable({},q)I.__index=I function I.new()local J=setmetatable(q.new(),I)J:Reset()return J end local k=Y.Spring function I.Reset(J)J.vehicleCameraCore=g.new(J:GetSubjectCFrame())J.pitchSpring=k.new(0,-math.rad(w.pitchBaseAngle))J.yawSpring=k.new(0,s)J.lastPanTick=0 local q=workspace.CurrentCamera local d=q and q.CameraSubject assert(q)assert(d)assert(d:IsA("\086\101\104\105\099\108\101\083\101\097\116"))local V,n=Y.getLooseBoundingSphere(d:GetConnectedParts(true))J.assemblyRadius=math.max(n,.001)J.assemblyOffset=d.CFrame:Inverse()*V J:_StepInitialZoom()end function I._StepInitialZoom(J)J:SetCameraToSubjectDistance(math.max(V.GetZoomRadius(),J.assemblyRadius*w.initialZoomRadiusMul))end local P=Y.sanitizeAngle local B=Y.mapClamp function I._StepRotation(s,q,Y)local V=s.yawSpring local g=s.pitchSpring local n=d.getRotation(true)V.pos=P(V.pos+-n.X)g.pos=P(math.clamp(g.pos+-n.Y,-J,J))if d.getRotationActivated()then s.lastPanTick=os.clock()end local A=-math.rad(w.pitchBaseAngle)local U=math.rad(w.pitchDeadzoneAngle)if w.autocorrectDelay<os.clock()-s.lastPanTick then local J=B(Y,w.autocorrectMinCarSpeed,w.autocorrectMaxCarSpeed,0,w.autocorrectResponse)V.freq=J g.freq=J if V.freq<.001 then V.vel=0 end if g.freq<.001 then g.vel=0 end if math.abs(P(A-g.pos))<=U then g.goal=g.pos else g.goal=A end else V.freq=0 V.vel=0 g.freq=0 g.vel=0 g.goal=A end return CFrame.fromEulerAnglesYXZ(g:step(q),V:step(q),0)end function I._GetThirdPersonLocalOffset(J)return J.assemblyOffset+Vector3.new(0,J.assemblyRadius*w.verticalCenterOffset,0)end function I._GetFirstPersonLocalOffset(J,s)local q=n.Character if q and q.Parent then local J=q:FindFirstChild("\072\101\097\100")if J and J:IsA("\066\097\115\101\080\097\114\116")then return s:Inverse()*J.Position end end return J:_GetThirdPersonLocalOffset()end local function o(J,s)return math.abs(s.YVector:Dot(J))end local function G(J,s)return math.abs(s.XVector:Dot(J))end function I.Update(J)local s=workspace.CurrentCamera local q=s and s.CameraSubject local d=J.vehicleCameraCore assert(s)assert(q)assert(q:IsA("\086\101\104\105\099\108\101\083\101\097\116"))U=0 local Y=J:GetSubjectCFrame()local V=J:GetSubjectRotVelocity()local g=o(V,Y)local w=G(V,Y)local n=J:StepZoom()local A=J:_StepRotation(U,math.abs((J:GetSubjectVelocity()):Dot(Y.ZVector)))local I=B(n,.5,J.assemblyRadius,1,0)local k=(J:_GetThirdPersonLocalOffset()):Lerp(J:_GetFirstPersonLocalOffset(Y),I)d:setTransform(Y)local P=(CFrame.new(Y*k)*d:step(U,w,g,I))*A return P*CFrame.new(0,0,n),P end function I.ApplyVRTransform(J) end function I.EnterFirstPerson(J)J.inFirstPerson=true J:UpdateMouseBehavior()end function I.LeaveFirstPerson(J)J.inFirstPerson=false J:UpdateMouseBehavior()end return I
-- Decompiled with the Synapse X Luau decompiler.

local v1 = math.rad(80)
local v2 = math.rad(0)
local v3 = require(script.Parent:WaitForChild("BaseCamera"))
local v4 = require(script.Parent:WaitForChild("CameraInput"))
local v5 = require(script.Parent:WaitForChild("CameraUtils"))
local v6 = require(script.Parent:WaitForChild("ZoomController"))
local v7 = require(script:WaitForChild("VehicleCameraCore"))
local v8 = require(script:WaitForChild("VehicleCameraConfig"))
local l__LocalPlayer__9 = game:GetService("Players").LocalPlayer
local l__map__10 = v5.map
local u1 = 0.016666666666666666
game:GetService("RunService").Stepped:Connect(function(p1, p2)
	u1 = p2
end)
local v11 = setmetatable({}, v3)
v11.__index = v11
function v11.new()
	local v12 = setmetatable(v3.new(), v11)
	v12:Reset()
	return v12
end
local l__Spring__2 = v5.Spring
function v11.Reset(p3)
	p3.vehicleCameraCore = v7.new(p3:GetSubjectCFrame())
	p3.pitchSpring = l__Spring__2.new(0, -math.rad(v8.pitchBaseAngle))
	p3.yawSpring = l__Spring__2.new(0, v2)
	p3.lastPanTick = 0
	local l__CurrentCamera__13 = workspace.CurrentCamera
	local v14 = l__CurrentCamera__13 and l__CurrentCamera__13.CameraSubject
	assert(l__CurrentCamera__13)
	assert(v14)
	assert(v14:IsA("VehicleSeat"))
	local v15, v16 = v5.getLooseBoundingSphere((v14:GetConnectedParts(true)))
	p3.assemblyRadius = math.max(v16, 0.001)
	p3.assemblyOffset = v14.CFrame:Inverse() * v15
	p3:_StepInitialZoom()
end
function v11._StepInitialZoom(p4)
	p4:SetCameraToSubjectDistance(math.max(v6.GetZoomRadius(), p4.assemblyRadius * v8.initialZoomRadiusMul))
end
local l__sanitizeAngle__3 = v5.sanitizeAngle
local l__mapClamp__4 = v5.mapClamp
function v11._StepRotation(p5, p6, p7)
	local l__yawSpring__17 = p5.yawSpring
	local l__pitchSpring__18 = p5.pitchSpring
	local v19 = v4.getRotation(true)
	l__yawSpring__17.pos = l__sanitizeAngle__3(l__yawSpring__17.pos + -v19.X)
	l__pitchSpring__18.pos = l__sanitizeAngle__3(math.clamp(l__pitchSpring__18.pos + -v19.Y, -v1, v1))
	if v4.getRotationActivated() then
		p5.lastPanTick = os.clock()
	end
	local v20 = -math.rad(v8.pitchBaseAngle)
	local v21 = math.rad(v8.pitchDeadzoneAngle)
	if v8.autocorrectDelay < os.clock() - p5.lastPanTick then
		local v22 = l__mapClamp__4(p7, v8.autocorrectMinCarSpeed, v8.autocorrectMaxCarSpeed, 0, v8.autocorrectResponse)
		l__yawSpring__17.freq = v22
		l__pitchSpring__18.freq = v22
		if l__yawSpring__17.freq < 0.001 then
			l__yawSpring__17.vel = 0
		end
		if l__pitchSpring__18.freq < 0.001 then
			l__pitchSpring__18.vel = 0
		end
		if math.abs(l__sanitizeAngle__3(v20 - l__pitchSpring__18.pos)) <= v21 then
			l__pitchSpring__18.goal = l__pitchSpring__18.pos
		else
			l__pitchSpring__18.goal = v20
		end
	else
		l__yawSpring__17.freq = 0
		l__yawSpring__17.vel = 0
		l__pitchSpring__18.freq = 0
		l__pitchSpring__18.vel = 0
		l__pitchSpring__18.goal = v20
	end
	return CFrame.fromEulerAnglesYXZ(l__pitchSpring__18:step(p6), l__yawSpring__17:step(p6), 0)
end
function v11._GetThirdPersonLocalOffset(p8)
	return p8.assemblyOffset + Vector3.new(0, p8.assemblyRadius * v8.verticalCenterOffset, 0)
end
function v11._GetFirstPersonLocalOffset(p9, p10)
	local l__Character__23 = l__LocalPlayer__9.Character
	if l__Character__23 and l__Character__23.Parent then
		local l__Head__24 = l__Character__23:FindFirstChild("Head")
		if l__Head__24 and l__Head__24:IsA("BasePart") then
			return p10:Inverse() * l__Head__24.Position
		end
	end
	return p9:_GetThirdPersonLocalOffset()
end
local function u5(p11, p12)
	return math.abs(p12.YVector:Dot(p11))
end
local function u6(p13, p14)
	return math.abs(p14.XVector:Dot(p13))
end
function v11.Update(p15)
	local l__CurrentCamera__25 = workspace.CurrentCamera
	local v26 = l__CurrentCamera__25 and l__CurrentCamera__25.CameraSubject
	local l__vehicleCameraCore__27 = p15.vehicleCameraCore
	assert(l__CurrentCamera__25)
	assert(v26)
	assert(v26:IsA("VehicleSeat"))
	u1 = 0
	local v28 = p15:GetSubjectCFrame()
	local v29 = p15:GetSubjectRotVelocity()
	local v30 = u5(v29, v28)
	local v31 = u6(v29, v28)
	local v32 = p15:StepZoom()
	local v33 = p15:_StepRotation(u1, (math.abs(p15:GetSubjectVelocity():Dot(v28.ZVector))))
	local v34 = l__mapClamp__4(v32, 0.5, p15.assemblyRadius, 1, 0)
	local v35 = p15:_GetThirdPersonLocalOffset():Lerp(p15:_GetFirstPersonLocalOffset(v28), v34)
	l__vehicleCameraCore__27:setTransform(v28)
	local v36 = CFrame.new(v28 * v35) * l__vehicleCameraCore__27:step(u1, v31, v30, v34) * v33
	return v36 * CFrame.new(0, 0, v32), v36
end
function v11.ApplyVRTransform(p16) end
function v11.EnterFirstPerson(p17)
	p17.inFirstPerson = true
	p17:UpdateMouseBehavior()
end
function v11.LeaveFirstPerson(p18)
	p18.inFirstPerson = false
	p18:UpdateMouseBehavior()
end
return v11
