Most of the examples I see in the code are far too advanced for my needs.
I just wanted to get at most 2 points that a line segment intersects with the rectangle. I would appreciate if you can help me where to look?
Most of the examples I see in the code are far too advanced for my needs.
I just wanted to get at most 2 points that a line segment intersects with the rectangle. I would appreciate if you can help me where to look?
Hi!
Is your rectangle axis-aligned? If so, you can represent it as an AABB and then call aabb.clip_line to retrieve the intersection segment. (The endpoints of this segment will be the intersection points.)
Thank you very much. I’ve been testing it, and it seems to cover most of my needs,
except for 2 cases:
However, both of this edge case can be mitigates by making separate conditional branch and only use the aabb box line clipping for the rest of the cases.