Quote:
To improve speed I'm using a pretty slow checking procedure that tests
the start and end points and whether the line intersects the box I'm
giving it as my screen.
The problem is, is that its slow... and so far I'm unable to find a
built in procedure for this or any fast code anywhere to solve the
problem. |
Maybe you could speed things up as follows. You have a rectangle for the
screen box. For each line, make a new rectangle with the line on one or the
other diagonal. Now use Rectangle.IntersectsWith on these two rectangles.
If false, you do not have an intersection, and if true you might, so run your
slow routine. If both (1) IntersectsWith is fast and (2) you have enough
lines that return false, you should speed things up. I haven't tried it, no
guarantees, just a suggestion.