Stop intersectSegSegTest returning True for collinear line pairs

This commit is contained in:
2026-03-12 13:37:56 +00:00
parent cdc21c9fb1
commit 65383e2303
15 changed files with 326 additions and 223 deletions
+28 -2
View File
@@ -11,6 +11,7 @@ module Dodge.Room.LasTurret (
lasCenRunClose,
) where
import Dodge.Room.Procedural
import qualified Data.Set as S
import Dodge.Cleat
import Dodge.Data.GenWorld
@@ -141,8 +142,8 @@ lasCenSensEdge n = do
, treePost [door, cleatLabel 0 corridor]
]
lasCenRunClose :: (RandomGen g) => State g (MetaTree Room String)
lasCenRunClose = do
lasCenRunClose' :: (RandomGen g) => State g (MetaTree Room String)
lasCenRunClose' = do
thelight <- mntLightLnkCond $ rprBool $ const . isInLnk
thelight1 <- mntLightLnkCond $ rprBool $ const . isOutLnk
r <-
@@ -169,6 +170,31 @@ lasCenRunClose = do
inlinkwall = linkwall isInLnk
outlinkwall = linkwall isOutLnk
lasCenRunClose :: (RandomGen g) => State g (MetaTree Room String)
lasCenRunClose = do
r <-
roomRectAutoLights 250 250
<&> rmPmnts
<>~ [ putLasTurret 0.02 & plSpot .~ PS (V2 220 20) 0
, inlinkwall 70 (rectNSWE 10 (-10) (-10) 30)
, inlinkwall 125 (rectNSWE 55 (-55) (-10) 10)
, inlinkwall 180 (rectNSWE 10 (-10) (-30) 10)
, outlinkwall 70 (rectNSWE 10 (-10) (-30) 10)
, outlinkwall 125 (rectNSWE 55 (-55) (-10) 10)
, outlinkwall 180 (rectNSWE 10 (-10) (-10) 30)
]
<&> rmLinks %~ setInLinks (memtest (FromEdge West 0) (OnEdge South))
<&> rmLinks %~ setOutLinks (memtest (FromEdge East 0) (OnEdge North))
rToOnward "lasCenRunClose" $ return $ cleatOnward r
where
memtest a b x = let y = _rlType x
in a `S.member` y && b `S.member` y
linkwall f x = heightWallPS
(resetPLUse $ rprBoolShift (const . f) (shiftInBy x <&> (,S.singleton UsedPosLow)))
30
inlinkwall = linkwall isInLnk
outlinkwall = linkwall isOutLnk
lasTunnel :: (RandomGen g) => Float -> State g Room
lasTunnel y = do
extraPlmnts <-