function CameraModule.GetCameraControlChoice(F)local C=Players.LocalPlayer if C then if F.lastInputType==Enum.UserInputType.Touch or UserInputService.TouchEnabled then if C.DevTouchCameraMode==Enum.DevTouchCameraMovementMode.UserChoice then return CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)else return CameraUtils.ConvertCameraModeEnumToStandard(C.DevTouchCameraMode)end else if C.DevComputerCameraMode==Enum.DevComputerCameraMovementMode.UserChoice then local F=CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)return CameraUtils.ConvertCameraModeEnumToStandard(F)else return CameraUtils.ConvertCameraModeEnumToStandard(C.DevComputerCameraMode)end end end end function CameraModule.OnCharacterAdded(R,F,C)if R.activeOcclusionModule then R.activeOcclusionModule:CharacterAdded(F,C)end end function CameraModule.OnCharacterRemoving(R,F,C)if R.activeOcclusionModule then R.activeOcclusionModule:CharacterRemoving(F,C)end end function CameraModule.OnPlayerAdded(C,F)F.CharacterAdded:Connect(function(R)C:OnCharacterAdded(R,F)end)F.CharacterRemoving:Connect(function(R)C:OnCharacterRemoving(R,F)end)end function CameraModule.OnMouseLockToggled(F)if F.activeMouseLockController then local C=F.activeMouseLockController:GetIsMouseLocked()local R=F.activeMouseLockController:GetMouseLockOffset()if F.activeCameraController then F.activeCameraController:SetIsMouseLocked(C)F.activeCameraController:SetMouseLockOffset(R)end end end local F=CameraModule.new()local C={}if FFlagUserRemoveTheCameraApi then return C else return F end
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types
function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer

	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevTouchCameraMode)
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode =
					CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end

function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end

local cameraModuleObject = CameraModule.new()
local cameraApi = {}

if FFlagUserRemoveTheCameraApi then
	return cameraApi
else
	return cameraModuleObject
end
