-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees

local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)

local TOUCH_ADJUST_AREA_UP = math.rad(30)
local TOUCH_ADJUST_AREA_DOWN = math.rad(-15)

local TOUCH_SENSITIVTY_ADJUST_MAX_Y = 2.1
local TOUCH_SENSITIVTY_ADJUST_MIN_Y = 0.5

local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4

local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)

local touchSensitivityFlagExists, touchSensitivityFlagEnabled = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserTouchSensitivityAdjust")
end)
local FFlagUserTouchSensitivityAdjust = touchSensitivityFlagExists and touchSensitivityFlagEnabled

local TOUCH_SENSITIVTY = Vector2.new(0.0045 * math.pi, 0.003375 * math.pi)
if FFlagUserTouchSensitivityAdjust then
	TOUCH_SENSITIVTY = Vector2.new(0.00945 * math.pi, 0.003375 * math.pi)
end
local MOUSE_SENSITIVITY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi )

local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)

local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20

local PAN_SENSITIVITY = 20
local ZOOM_SENSITIVITY_CURVATURE = 0.5

local abs = math.abs
local sign = math.sign

local thirdGamepadZoomStepFlagExists, thirdGamepadZoomStepFlagEnabled = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserThirdGamepadZoomStep")
end)
local FFlagUserThirdGamepadZoomStep = thirdGamepadZoomStepFlagExists and thirdGamepadZoomStepFlagEnabled

local FFlagUserPointerActionsInPlayerScripts do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserPointerActionsInPlayerScripts")
	end)
	FFlagUserPointerActionsInPlayerScripts = success and result
end

local FFlagUserNoMoreKeyboardPan do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserNoMoreKeyboardPan")
	end)
	FFlagUserNoMoreKeyboardPan = success and result
end

local fixZoomIssuesFlagExists, fixZoomIssuesFlagEnabled = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserFixZoomClampingIssues")
end)
local FFlagUserFixZoomClampingIssues = fixZoomIssuesFlagExists and fixZoomIssuesFlagEnabled

local Util = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
