Files
loop/src/Dodge/CullBox.hs
T
2022-06-18 00:18:18 +01:00

26 lines
821 B
Haskell

module Dodge.CullBox
(cullBox
) where
import Dodge.Data
--import Dodge.GameRoom
import Dodge.Base.Window
--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'
| debugOn Bound_box_screen cfig = screenPolygon cfig w'
| otherwise = 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
--