Improve segment intersection test, tweak room bounding
This commit is contained in:
@@ -139,22 +139,18 @@ intersectSegSegFullTest x y z w =
|
||||
|
||||
{- | It is not always necessary to find a point of intersection, sometimes a
|
||||
test may suffice.
|
||||
This should intersect on endpoints.
|
||||
-}
|
||||
intersectSegSegTest ::
|
||||
Point2 ->
|
||||
Point2 ->
|
||||
Point2 ->
|
||||
Point2 ->
|
||||
Bool
|
||||
intersectSegSegTest :: Point2 -> Point2 -> Point2 -> Point2 -> Bool
|
||||
{-# INLINE intersectSegSegTest #-}
|
||||
intersectSegSegTest x y z w =
|
||||
f x y z w && f z w x y && x /= y && z /= w
|
||||
where
|
||||
f a b c d =
|
||||
f a b c d = compareLHS a b c /= compareLHS a b d
|
||||
-- (not (isRHS a b c) && not (isLHS a b d))
|
||||
-- || (not (isLHS a b c) && not (isRHS a b d))
|
||||
(isRHS a b c && isLHS a b d)
|
||||
|| (isLHS a b c && isRHS a b d)
|
||||
-- (isRHS a b c && isLHS a b d)
|
||||
-- || (isLHS a b c && isRHS a b d)
|
||||
|
||||
intersectSegSegPreTest ::
|
||||
Point2 ->
|
||||
|
||||
Reference in New Issue
Block a user