I have made myself a simple script that determines if two arcs which have a width overlap:
Currently its quite slow and inefficient and was wondering if any one knows a more efficient mathematical solution to solve this?
My current setup to solve overlap is done with the following steps:
Find intersecting points of the 4 circles (inner and outer radius of both arcs). Check if the intersecting points is inside the angle range of the arcs.
Next i do 4 tests to determine if the ends of arcs overlap which is 4 line segments tested against the 4 arcs which represent the inner and outer ranges of the radius of the pieces.
Since i do this every frame this is a lot of calculations. I am wondering if any smart person here knows a simpler mathematical approach that might simplify my current solution.
My arcs are represented by StartAngle, EndAngle, Origin and MinRadius/MaxRadius.