-- Time it takes to tween between view switches:

local TWEEN_DURATION = 0.25


local V3 = Vector3.new
local CF = CFrame.new
local ANG = CFrame.Angles
local ACOS = math.acos
local COS = math.cos
local SIN = math.sin
local RAND = math.random
local TAU = math.pi * 2


local CamLock = {}

local cam = game.Workspace.CurrentCamera
local plane
local seat

local currentViewIndex = 1
local currentView

local viewRotH = 0
local viewRotV = 0
local MAX_VIEW_ROT_V = math.rad(80)

local mobileDeviceBank = 0

local Damping = require(script:WaitForChild("Damping"))
local easing = require(script:WaitForChild("Easing"))

local dampCam = Damping.new()
local dampRot = Damping.new()
local dampShake = Damping.new()
	dampShake.P = 3
	dampShake.D = 0.05


local tweening = false
local tweenStart = 0
local tweenFromView = nil



local views = {
	
	-- Pivot:   Point around which camera rotates
	-- Offset:  Camera offset from pivot point
	-- Ease:    Ease function used when tweening into the view
	
	-- Third-person:
	{
		Pivot   = CF(0, 3.5, -1.1);
		Offset  = CF(0, 8, 40);
		Ease    = easing.outQuint;
	};

	-- First-person:
	{
		Pivot   = CF(0, 3.5, -1.1);
		Offset  = CF(0, 0, 0);
		Ease    = easing.outQuint;
	};
	
	-- Landing gear:
	{
		Pivot   = CF(0, -3.5, -0.5);
		Offset  = CF(0, 0, 0);
		Ease    = easing.outQuint;
	};
	
}

