function CameraUtils.GetAngleBetweenXZVectors(y,Z)return math.atan2(Z.X*y.Z-Z.Z*y.X,Z.X*y.X+Z.Z*y.Z)end function CameraUtils.RotateVectorByAngleAndRound(y,Z,s)if y.Magnitude>0 then y=y.unit local A=math.atan2(y.z,y.x)local M=round((math.atan2(y.z,y.x)+Z)/s)*s return M-A end return 0 end
-- Legacy implementation renamed
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
