This commit is contained in:
2025-10-10 11:30:05 +01:00
parent e00bb0b26e
commit 98ece551c7
2 changed files with 1 additions and 16 deletions
+1
View File
@@ -6,3 +6,4 @@ loop.cabal
keys.json
log/*
generated/*
tags
-16
View File
@@ -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