From 98ece551c70faf02a3efb574fb7670d4ef77d435 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 10 Oct 2025 11:30:05 +0100 Subject: [PATCH] cleanup --- .gitignore | 1 + src/Dodge/Base/Collide.hs | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 95ed42d95..22b2ad4c9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ loop.cabal keys.json log/* generated/* +tags diff --git a/src/Dodge/Base/Collide.hs b/src/Dodge/Base/Collide.hs index 55cb27546..d5b537263 100644 --- a/src/Dodge/Base/Collide.hs +++ b/src/Dodge/Base/Collide.hs @@ -49,7 +49,6 @@ import Dodge.Data.World import Dodge.Zoning import FoldableHelp import Geometry -import Linear.Metric collidePoint :: Point2 -> Point2 -> [Wall] -> (Point2, Maybe Wall) {-# INLINE collidePoint #-} @@ -152,8 +151,6 @@ collide3Wall sp wl (ep, mo) = maybe (ep, mo) (,Just (n, OWall wl)) $ intersectSe collide3Creature :: Point3 -> Creature -> (Point3, MPO) -> (Point3, MPO) collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do --- (sp', ep') <- restrictSeg 0 (V3 0 0 1) (sp, ep) --- >>= restrictSeg (V3 0 0 25) (V3 0 0 (-1)) h <- crHeight cr (p,n) <- fst $ intersectCylSeg (addZ (cr ^. crZ) cpos) @@ -162,9 +159,6 @@ collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do sp ep return (p, Just (n,OCreature cr)) --- p <- listToMaybe $ intersectCircSeg cpos (crRad $ cr ^. crType) (xyV3 sp') (xyV3 ep') --- let z = 0 --- return (p `v2z` z, Just (normalize $ (p - cpos) `v2z` 0, OCreature cr)) where cpos = cr ^. crPos @@ -175,16 +169,6 @@ crHeight cr = case cr ^. crHP of CrIsGibs -> Nothing CrIsPitted -> Nothing -restrictSeg :: Point3 -> Point3 -> (Point3, Point3) -> Maybe (Point3, Point3) -restrictSeg p n (sp, ep) - | isNHS p n sp - , isNHS p n ep = - Just (sp, ep) - | isNHS p n sp = (sp,) <$> intersectSegPlane sp ep p n - | otherwise = (,ep) <$> intersectSegPlane sp ep p n - --- note if both sp & ep are not NHS, this returns Nothing - wallToSurface :: Wall -> (Point3, Point3, [(Point3, Point3)]) wallToSurface wl = (g x, g $ vNormal (x - y), [(g x, g (y - x)), (g y, g (x - y))]) where