Improve door crushing

This commit is contained in:
2026-03-26 19:21:10 +00:00
parent 31d7a00ecf
commit 01b765300e
10 changed files with 107 additions and 87 deletions
+3 -2
View File
@@ -26,6 +26,7 @@ import Geometry
import LensHelp
import SDL (MouseButton (..))
import qualified SDL
import qualified Data.IntMap.Strict as IM
{- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers;
update where your avatar's view is from. -}
@@ -220,7 +221,7 @@ rotateToOverlappingWall w =
maybe
id
(doWallRotate . snd)
(overlapCircWallsClosest p r (filter _wlRotateTo $ wlsNearCirc p r w))
(overlapCircWallsClosest p r (filter _wlRotateTo . IM.elems $ wlsNearCirc p r w))
w
where
r = crRad (cr ^. crType) + 10
@@ -245,7 +246,7 @@ farWallDistDirection :: Point2 -> World -> Maybe (Float, Float, Float, Float)
farWallDistDirection p w = boundPoints $ map f $ getViewpoints p (_cWorld w)
where
f q = (rotateV (negate (w ^. wCam . camRot)) . (-.- p)) (foldl' findPoint q (wls q))
wls q = filter wlIsOpaque $ wlsNearSeg p q w
wls q = filter wlIsOpaque . IM.elems $ wlsNearSeg p q w
findPoint q = fromMaybe q . uncurry (intersectSegSeg p q) . _wlLine
findBoundDists :: Config -> World -> (Float, Float, Float, Float)