-- Simulate camera shake (not great, but works well enough for this):

local function GetCameraShake()
	local dragAngle = Angle(seat.CFrame.lookVector, seat.Velocity)
	local speed = seat.Velocity.Magnitude
	
	local shakeMagnitude = (speed * 0.02) * dragAngle * 0.1
	
	local theta = RAND() * TAU
	local x = COS(theta) * shakeMagnitude
	local y = SIN(theta) * shakeMagnitude
	--                   ^
	-- THE STARS ALIGN   ^   DUN DUN DUN
	--                   ^
	
	return V3(x, y, 0)
end


local function GetCameraRotation()
	
	-- Relative rotational velocity:
	dampCam.Goal = -seat.CFrame:vectorToObjectSpace(seat.RotVelocity) * 0.1
	local relRotVel = dampCam:Update()
	
	-- Camera shake offset:
	dampShake.Goal = GetCameraShake()
	local shake = CF(dampShake:Update())
	
	-- User view rotation:
	local viewRotation = dampRot:Update()
	viewRotation = ANG(0, viewRotation.X, 0) * ANG(viewRotation.Y, 0, 0)
	
	return ANG(0, 0, mobileDeviceBank) * viewRotation * ANG(relRotVel.X, relRotVel.Y, relRotVel.Z) * shake
	
end

