-- Returns the radius of the spread, but projected into screen space.
-- @param Camera camera
-- @return number

function SpreadSimulator:GetSpreadScreenMagnitude(camera)
	
	local cameraCFrame = camera.CFrame
	local spreadDirection = self:GetSpreadDirectionCircumferenceVector(camera.CFrame)
	
	local spreadPosition = cameraCFrame.Position + cameraCFrame.LookVector * Spread_Distance_From_Camera + spreadDirection 
	
	local centerPoint, onScreen1 = camera:WorldToScreenPoint(cameraCFrame.Position + cameraCFrame.LookVector * Spread_Distance_From_Camera)
	
	local screenPoint, onScreen2 = camera:WorldToScreenPoint(spreadPosition)
	
	-- If one of the points are not on screen then we can't do much with math
	if not onScreen1 or not onScreen2 then return end
	
	local spreadPoint = Vector2.new(screenPoint.x, screenPoint.y)
	local centerPoint = Vector2.new(centerPoint.x, centerPoint.y)
	
	local distance = (spreadPoint - centerPoint).Magnitude * 2 -- Radius times 2
	
	return distance
end
p
return SpreadSimulator
