local p=-80 local J=80 local v={}v.InitialDistance=25 v.MinDistance=10 v.MaxDistance=100 v.InitialElevation=35 v.MinElevation=35 v.MaxElevation=35 v.ReferenceAzimuth=-45 v.CWAzimuthTravel=90 v.CCWAzimuthTravel=90 v.UseAzimuthLimits=false local A local d local g local X local M local t local D local V local O local c local P local Q=Vector3.new(0,0,1)local i=2*math.pi local z={}

local MIN_ALLOWED_ELEVATION_DEG = -80
local MAX_ALLOWED_ELEVATION_DEG = 80

local externalProperties = {}
externalProperties["InitialDistance"] 	= 25
externalProperties["MinDistance"] 		= 10
externalProperties["MaxDistance"] 		= 100
externalProperties["InitialElevation"] 	= 35
externalProperties["MinElevation"] 		= 35
externalProperties["MaxElevation"] 		= 35
externalProperties["ReferenceAzimuth"] 	= -45	-- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally
externalProperties["CWAzimuthTravel"] 	= 90	-- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above
externalProperties["CCWAzimuthTravel"] 	= 90	-- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above
externalProperties["UseAzimuthLimits"] 	= false -- Full rotation around Y axis available by default

local refAzimuthRad
local curAzimuthRad
local minAzimuthAbsoluteRad
local maxAzimuthAbsoluteRad
local useAzimuthLimits
local curElevationRad
local minElevationRad
local maxElevationRad
local curDistance
local minDistance
local maxDistance

local UNIT_Z = Vector3.new(0,0,1)
local TAU = 2 * math.pi

local changedSignalConnections = {}
