Line intersection with AABB Rectangle?
问题 Preferably without using any kind of loop, as this\'ll be used in a game. I wish to intersect a line with a rectangle, of arbitrary size. But I also wish for the intersection point[s] to be returned. It\'s possible, I\'ve done a little googling, but still have not worked it out. The line is defined using (x1,y1,x2,y2). The rectangle has these two points too. 回答1: I would recommend simply doing a line-segment-line-segment intersection check on each line segment (edge) that makes up the