Fix bug when forming convex hull of game room bounds

This commit is contained in:
2021-09-30 23:46:59 +01:00
parent cb23960bd7
commit 1414d08d88
14 changed files with 51 additions and 16 deletions
+7 -4
View File
@@ -2,6 +2,8 @@
module Dodge.Render.Picture
where
import Dodge.Data
import Dodge.Update.Camera
import Dodge.GameRoom
import Dodge.Base
import Dodge.Base.Window
import Dodge.Zone
@@ -62,10 +64,11 @@ customMouseCursor w =
$ pictures [ line [V2 (-5) 0,V2 5 0] , line [V2 0 (-5),V2 0 5] ]
testPic :: World -> Picture
testPic _ = pictures
[
-- , fixedSizePicClampArrow 10 50 thepic (mouseWorldPos w) w
]
testPic w = setLayer 5 $ color green (concatMap (polygonWire . _grBound) grs)
<> color yellow (concatMap (\q -> line [p,q]) $ farWallPoints p w)
where
p = _crPos $ you w
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
-- where
-- thepic = setDepth 20 . color green . polygon $ rectNSEW 5 (-5) (-5) (5)
--testPic _ = blank