function CameraUtils.GetAngleBetweenXZVectors(C,Q)return math.atan2(Q.X*C.Z-Q.Z*C.X,Q.X*C.X+Q.Z*C.Z)end function CameraUtils.RotateVectorByAngleAndRound(C,Q,A)if C.Magnitude>0 then C=C.unit local m=math.atan2(C.z,C.x)local L=round((math.atan2(C.z,C.x)+Q)/A)*A return L-m 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
