Continue refactor

This commit is contained in:
2022-06-28 03:29:55 +01:00
parent e06527091e
commit 480fc2df5e
7 changed files with 17 additions and 25 deletions
+9 -15
View File
@@ -57,18 +57,12 @@ thingsHitExceptCr (Just cid) sp ep = S.filter crNotCid . thingsHit sp ep
crNotCid (_,Left cr) = _crID cr /= cid
crNotCid _ = True
--wallsHit
-- :: Point2 -- ^ Line start point
-- -> Point2 -- ^ Line end point
-- -> World
-- -> [(Point2, Wall)]
--wallsHit sp ep w
-- | sp == ep = []
-- | otherwise = sortOn (dist sp . fst) wls
-- where
-- wls = IM.elems $ wallsOnLineHit sp ep
-- $ IM.unions [f b $ f a $ _znObjects $ _wallsZone w
-- | a<-[x-1,x,x+1] , b<-[y-1,y,y+1]]
-- -- $ _walls w
-- V2 x y = wallZoneOfPoint (0.5 *.* (sp +.+ ep))
-- f i = fromMaybe IM.empty . IM.lookup i
wallsHit
:: Point2 -- ^ Line start point
-> Point2 -- ^ Line end point
-> World
-> Stream (Of (Point2, Wall)) Identity ()
wallsHit sp ep w
| sp == ep = S.each []
| otherwise = sortStreamOn (dist sp . fst)
. overlapSegWalls sp ep $ wallsAlongLine sp ep w