Improve segment intersection test, tweak room bounding

This commit is contained in:
2026-03-12 15:23:37 +00:00
parent 65383e2303
commit 24af6a731b
6 changed files with 41 additions and 30 deletions
+6 -5
View File
@@ -10,7 +10,7 @@ module Dodge.Tree.Shift (
PosRooms (..),
) where
import Data.Monoid
--import Data.Monoid
import Control.Lens
import Data.Bifunctor
import Data.List (delete)
@@ -67,9 +67,10 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
where
tryChildLinks [] = tryParentLinks ls
tryChildLinks ((numinlink, il) : ils)
| Just xs <- clipping' = do
putStrLn $ show xs
tryChildLinks ils
-- | Just xs <- clipping' = do
-- putStrLn $ show xs
-- tryChildLinks ils
| clipping = tryChildLinks ils
| otherwise = do
putStrLn $ show j ++ "-" ++ show numinlink
mayrs <-
@@ -86,7 +87,7 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
where
newBounds = map pointsToPoly . _rmBound . doRoomShift . fst $ rootLabel shiftedt
clipping = or (convexPolysOverlap <$> newBounds <*> _prBounds prs)
clipping' = getFirst . foldMap First $ convexPolysOverlapWitness <$> newBounds <*> _prBounds prs
-- clipping' = getFirst . foldMap First $ convexPolysOverlapWitness <$> newBounds <*> _prBounds prs
updateparent rm =
_rmLinkEff rm il child numChild outlnk rm
& rmLinks %~ delete outlnk