Add aggressive light culling

This commit is contained in:
2022-06-17 18:24:24 +01:00
parent 55341f7caf
commit cbfb417d21
26 changed files with 114 additions and 47 deletions
+6
View File
@@ -233,6 +233,12 @@ collidePointWalls p1 p2
where
findPoint (x,y) p = fromMaybe p $ intersectSegSeg p1 p x y
collidePointWallsFilter :: (Wall -> Bool) -> Point2 -> Point2 -> IM.IntMap Wall -> Point2
collidePointWallsFilter t p1 p2
= foldr findPoint p2 . fmap _wlLine . IM.filter t
where
findPoint (x,y) p = fromMaybe p $ intersectSegSeg p1 p x y
-- | Looks for first collision of a circle with walls.
-- If found, gives point and reflection velocity, reflection damped in normal.
-- note that the "intersection" point is the center of the circle flush against the wall