I want to be able to see if two LineRenderers are overlapping or not. In my game I'll have two kinds of lines: The one I'm currently drawing (endpoint is where the mouse is) and the ones that I've already defined (previously drawn)
Each line (apart from the one that the player is currently drawing) is stored in a static List<Line> where Line is just a class with two properties:
public class Line {
public Vector2 StartPoint { get; set; }
public Vector2 EndPoint { get; set; }
}
How could I detect if the currently drawn line is overlapping with any of the already defined lines in this List<Line>? I want to have a function in the Line class signed as bool Intersectes(Line otherLine). Any help is much appreciated! 😄