local W=require(baseCameraModule)W.UpCFrame=IDENTITYCF function W.UpdateUpCFrame(h,W)h.UpCFrame=W end function W.CalculateNewLookCFrame(h,W)local U=W or h:GetCameraLookVector()U=h.UpCFrame:VectorToObjectSpace(U)local B=math.asin(U.y)local g=math.clamp(h.rotateInput.y,-MAX_Y+B,-MIN_Y+B)local T=Vector2.new(h.rotateInput.x,g)local O=CFrame.new(ZERO,U)local t=(CFrame.Angles(0,-T.x,0)*O)*CFrame.Angles(-T.y,0,0)return t end


local BaseCamera = require(baseCameraModule)

BaseCamera.UpCFrame = IDENTITYCF

function BaseCamera:UpdateUpCFrame(cf)
	self.UpCFrame = cf
end

function BaseCamera:CalculateNewLookCFrame(suppliedLookVector)
	local currLookVector = suppliedLookVector or self:GetCameraLookVector()
	currLookVector = self.UpCFrame:VectorToObjectSpace(currLookVector)
	
	local currPitchAngle = math.asin(currLookVector.y)
	local yTheta = math.clamp(self.rotateInput.y, -MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle)
	local constrainedRotateInput = Vector2.new(self.rotateInput.x, yTheta)
	local startCFrame = CFrame.new(ZERO, currLookVector)
	local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0)
	
	return newLookCFrame
end
