Add aggressive light culling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user