Allow more general detection of item use focus

This commit is contained in:
2024-12-25 21:26:25 +00:00
parent aec56f4977
commit c788af47bd
12 changed files with 28 additions and 32 deletions
+1 -6
View File
@@ -149,7 +149,7 @@ overlapCircWalls p r = mapMaybe dointersect
circHitWall :: Point2 -> Point2 -> Float -> World -> Bool
circHitWall sp ep r w = any (uncurry (intersectSegSegTest sp ep) . _wlLine)
(wlsNearSeg sp ep w)
|| any (uncurry (circOnSeg ep r) . _wlLine) (wlsNearPoint ep w)
|| circOnSomeWall ep r w
-- | note that this does not push the circle away from the wall at all
collideCircWalls :: Point2 -> Point2 -> Float -> [Wall] -> (Point2, Maybe Wall)
@@ -190,11 +190,6 @@ circOnSomeWall p rad =
any (uncurry (circOnSeg p rad) . _wlLine)
. wlsNearPoint p
--circOnSomeWall :: Point2 -> Float -> World -> Bool
--{-# INLINE circOnSomeWall #-}
--circOnSomeWall p rad = runIdentity . S.any_ (uncurry (circOnSeg p rad) . _wlLine)
-- . wlsNearPoint p
circOnAnyCr :: Point2 -> Float -> World -> Bool
{-# INLINE circOnAnyCr #-}
circOnAnyCr p r w = IS.foldr f False $ crIXsNearPoint p w