cleanup
This commit is contained in:
@@ -6,3 +6,4 @@ loop.cabal
|
|||||||
keys.json
|
keys.json
|
||||||
log/*
|
log/*
|
||||||
generated/*
|
generated/*
|
||||||
|
tags
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ import Dodge.Data.World
|
|||||||
import Dodge.Zoning
|
import Dodge.Zoning
|
||||||
import FoldableHelp
|
import FoldableHelp
|
||||||
import Geometry
|
import Geometry
|
||||||
import Linear.Metric
|
|
||||||
|
|
||||||
collidePoint :: Point2 -> Point2 -> [Wall] -> (Point2, Maybe Wall)
|
collidePoint :: Point2 -> Point2 -> [Wall] -> (Point2, Maybe Wall)
|
||||||
{-# INLINE collidePoint #-}
|
{-# 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 :: Point3 -> Creature -> (Point3, MPO) -> (Point3, MPO)
|
||||||
collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do
|
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
|
h <- crHeight cr
|
||||||
(p,n) <- fst $ intersectCylSeg
|
(p,n) <- fst $ intersectCylSeg
|
||||||
(addZ (cr ^. crZ) cpos)
|
(addZ (cr ^. crZ) cpos)
|
||||||
@@ -162,9 +159,6 @@ collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do
|
|||||||
sp
|
sp
|
||||||
ep
|
ep
|
||||||
return (p, Just (n,OCreature cr))
|
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
|
where
|
||||||
cpos = cr ^. crPos
|
cpos = cr ^. crPos
|
||||||
|
|
||||||
@@ -175,16 +169,6 @@ crHeight cr = case cr ^. crHP of
|
|||||||
CrIsGibs -> Nothing
|
CrIsGibs -> Nothing
|
||||||
CrIsPitted -> 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 :: Wall -> (Point3, Point3, [(Point3, Point3)])
|
||||||
wallToSurface wl = (g x, g $ vNormal (x - y), [(g x, g (y - x)), (g y, g (x - y))])
|
wallToSurface wl = (g x, g $ vNormal (x - y), [(g x, g (y - x)), (g y, g (x - y))])
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user