Check if a polygon overlaps with a rectangle: Difference between revisions

mNo edit summary
Line 515:
for axis in a
if projectionoverlaps(projectiononaxis(poly1, axis), projectiononaxis(poly2, axis))
return truefalse
end
end
end
return falsetrue
end
 
Line 538:
rect2 = Rectangle with (x = 1.0, y = 0.0, w = 8.0, h = 2.0)
 
poly and rect1 overlap? truefalse
poly and rect2 overlap? falsetrue
</pre>
 
4,107

edits