function CameraUtils.GetAngleBetweenXZVectors(U,I)return math.atan2(I.X*U.Z-I.Z*U.X,I.X*U.X+I.Z*U.Z)end function CameraUtils.RotateVectorByAngleAndRound(U,I,s)if U.Magnitude>0 then U=U.unit local Q=math.atan2(U.z,U.x)local C=round((math.atan2(U.z,U.x)+I)/s)*s return C-Q end return 0 end

function CameraUtils.GetAngleBetweenXZVectors(v1, v2)
	return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z)
end

function  CameraUtils.RotateVectorByAngleAndRound(camLook, rotateAngle, roundAmount)
	if camLook.Magnitude > 0 then
		camLook = camLook.unit
		local currAngle = math.atan2(camLook.z, camLook.x)
		local newAngle = round((math.atan2(camLook.z, camLook.x) + rotateAngle) / roundAmount) * roundAmount
		return newAngle - currAngle
	end
	return 0
end
