Separate out concrete part of world
This commit is contained in:
@@ -10,19 +10,19 @@ import qualified Data.IntSet as IS
|
||||
import Control.Lens
|
||||
|
||||
wlIXsNearPoint :: Point2 -> World -> IS.IntSet
|
||||
wlIXsNearPoint p w = zoneExtract (zoneOfPoint' wlZoneSize p) (w ^. wlZoning)
|
||||
wlIXsNearPoint p w = zoneExtract (zoneOfPoint' wlZoneSize p) (w ^. cWorld . wlZoning)
|
||||
|
||||
wlIXsNearSeg :: Point2 -> Point2 -> World -> IS.IntSet
|
||||
wlIXsNearSeg sp ep w = zonesExtract (w ^. wlZoning) (zoneOfSeg' wlZoneSize sp ep)
|
||||
wlIXsNearSeg sp ep w = zonesExtract (w ^. cWorld . wlZoning) (zoneOfSeg' wlZoneSize sp ep)
|
||||
|
||||
wlIXsNearRect :: Point2 -> Point2 -> World -> IS.IntSet
|
||||
wlIXsNearRect sp ep w = zonesExtract (w ^. wlZoning) $ zoneOfRect' wlZoneSize sp ep
|
||||
wlIXsNearRect sp ep w = zonesExtract (w ^. cWorld . wlZoning) $ zoneOfRect' wlZoneSize sp ep
|
||||
|
||||
wlIXsNearCirc :: Point2 -> Float -> World -> IS.IntSet
|
||||
wlIXsNearCirc p r = wlIXsNearRect (p +.+ V2 r r) (p -.- V2 r r)
|
||||
|
||||
wlsFromIXs :: World -> IS.IntSet -> [Wall]
|
||||
wlsFromIXs w = mapMaybe (\wlid -> w ^? walls . ix wlid) . IS.toList
|
||||
wlsFromIXs w = mapMaybe (\wlid -> w ^? cWorld . walls . ix wlid) . IS.toList
|
||||
|
||||
wlsNearPoint :: Point2 -> World -> [Wall]
|
||||
wlsNearPoint p w = wlsFromIXs w $ wlIXsNearPoint p w
|
||||
|
||||
Reference in New Issue
Block a user