Improve xIntercepts (still not perfect)
This commit is contained in:
@@ -13,6 +13,7 @@ module Dodge.WorldEvent.ThingsHit (
|
||||
wlsHitRadial,
|
||||
crHit,
|
||||
crWlPbHit,
|
||||
wlsHitUnsorted,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
@@ -131,11 +132,13 @@ thingsHitExceptCr (Just cid) sp ep = filter t . thingsHit sp ep
|
||||
t = (Just cid /=) . (^? _2 . _Left . crID)
|
||||
|
||||
wlsHit :: Point2 -> Point2 -> World -> [(Point2, Wall)]
|
||||
wlsHit sp ep
|
||||
wlsHit sp ep = sortOn (dist sp . fst) . wlsHitUnsorted sp ep
|
||||
|
||||
wlsHitUnsorted :: Point2 -> Point2 -> World -> [(Point2, Wall)]
|
||||
wlsHitUnsorted sp ep
|
||||
| sp == ep = const mempty
|
||||
| otherwise =
|
||||
sortOn (dist sp . fst)
|
||||
. overlapSegWalls sp ep
|
||||
overlapSegWalls sp ep
|
||||
. wlsNearSeg sp ep
|
||||
|
||||
wlsHitRadial :: Point2 -> Float -> World -> [(Point2, Wall)]
|
||||
|
||||
Reference in New Issue
Block a user