Improve room clip testing
This commit is contained in:
+7
-2
@@ -226,9 +226,14 @@ polysIntersect (p:ps) (q:qs)
|
||||
where
|
||||
pairs1 = zip (p:ps) (ps++[p])
|
||||
pairs2 = zip (q:qs) (qs++[q])
|
||||
polysIntersect _ _ = False
|
||||
|
||||
polysIntersect [] _ = False
|
||||
polysIntersect _ [] = False
|
||||
-- | Test whether two polygons intersect or if one is contained in the other.
|
||||
polysOverlap :: [Point2] -> [Point2] -> Bool
|
||||
polysOverlap (p:ps) (q:qs) = polysIntersect (p:ps) (q:qs)
|
||||
|| pointInPolygon p (q:qs)
|
||||
|| pointInPolygon q (p:ps)
|
||||
polysOverlap _ _ = False
|
||||
|
||||
-- | Test whether any polygons from a first list intersect with any polygons from
|
||||
-- a second list.
|
||||
|
||||
Reference in New Issue
Block a user