module Dodge.CullBox (cullBox ) where import Dodge.Data import Dodge.GameRoom import Dodge.Base import Dodge.Zone import Geometry import Dodge.Update.Camera import Shape import Data.Maybe (mapMaybe) cullBox :: Configuration -> World -> [Point2] --cullBox cfig w = farWallPoints cp w cullBox cfig w' = let (n,s,e,w) = farWallDistDirection (_cameraCenter w') cfig w' in map ((+.+ _cameraCenter w') . rotateV (_cameraRot w') ) $ rectNSWE n (negate s) (negate w) e -- --mapMaybe (fmap (fst . _wlLine . snd) . f) $ screenPolygon cfig w -- where -- grs = filter (pointInOrOnPolygon cp . _grBound) (_gameRooms w) -- cp = _cameraCenter w -- f p = collidePointWallsWall cp p $ wallsAlongLine cp p w --