Allow for complex room bounds for clip checks
This commit is contained in:
@@ -28,8 +28,8 @@ shiftRoomTreeSearch bs (Node r ts :<| ts')
|
||||
| roomIsClipping = Nothing
|
||||
| otherwise = fmap (r :) $ shiftRoomTreeSearch newBounds $ ts' >< children
|
||||
where
|
||||
roomIsClipping = any (polysIntersect (_rmBound r)) bs
|
||||
newBounds = _rmBound r : bs
|
||||
roomIsClipping = or (polysIntersect <$> _rmBound r <*> bs)
|
||||
newBounds = _rmBound r ++ bs
|
||||
children = fromList $ zipWith (\l -> applyToRoot (shiftRoomToLink l))
|
||||
(_rmLinks r)
|
||||
ts
|
||||
@@ -48,8 +48,8 @@ shiftRoomTreeSearchAll bs (Node r ts :<| ts')
|
||||
(s:ss) -> concatMap (\l -> shiftRoomTreeSearchAll bs (Node (rm l) ss <| (ts' |> f l s))) ls
|
||||
where
|
||||
ls = init $ _rmLinks r
|
||||
newBounds = _rmBound r : bs
|
||||
roomIsClipping = any (polysOverlap (_rmBound r)) bs
|
||||
newBounds = _rmBound r ++ bs
|
||||
roomIsClipping = or (polysOverlap <$> _rmBound r <*> bs)
|
||||
rm l = r & rmLinks %~ delete l
|
||||
f l = applyToRoot (shiftRoomToLink l)
|
||||
{- |
|
||||
|
||||
Reference in New Issue
Block a user