Non-convex chasms
This commit is contained in:
@@ -21,7 +21,7 @@ module Dodge.WorldEvent.ThingsHit (
|
||||
import ListHelp
|
||||
import Control.Applicative
|
||||
import Dodge.Wall.Pathing
|
||||
import Data.Monoid
|
||||
--import Data.Monoid
|
||||
import qualified Data.Set as S
|
||||
import Linear
|
||||
import Dodge.Data.Object
|
||||
@@ -182,6 +182,9 @@ isFlyable p1 p2 =
|
||||
|
||||
isWalkable :: Point2 -> Point2 -> World -> Bool
|
||||
{-# INLINE isWalkable #-}
|
||||
isWalkable p1 p2 w = isFlyable p1 p2 w && not (getAny $ foldMap f (w ^. cWorld . chasms))
|
||||
isWalkable p1 p2 w = isFlyable p1 p2 w && not (any f (w ^. cWorld . cliffs))
|
||||
where
|
||||
f = foldMap (Any . isJust . uncurry (intersectSegSeg p1 p2)) . loopPairs
|
||||
f = isJust . uncurry (intersectSegSeg p1 p2)
|
||||
--isWalkable p1 p2 w = isFlyable p1 p2 w && not (getAny $ foldMap f (w ^. cWorld . chasms))
|
||||
-- where
|
||||
-- f = foldMap (Any . isJust . uncurry (intersectSegSeg p1 p2)) . loopPairs
|
||||
|
||||
Reference in New Issue
Block a user