Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool doOverlap(Point l1, Point r1, Point l2, Point r2)
- {
- // If one rectangle is on left side of other
- if (l1.x > r2.x || l2.x > r1.x)
- return false;
- // If one rectangle is above other
- if (l1.y < r2.y || l2.y < r1.y)
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement