This commit is contained in:
2022-06-18 00:18:18 +01:00
parent a7c03671d3
commit 6a095d3de6
12 changed files with 49 additions and 36 deletions
+12 -6
View File
@@ -41,12 +41,12 @@ worldSPic cfig w =
<> foldMap mcSPic (filtOn _mcPos _machines)
where
filtOn f g = IM.filter (pointIsClose . f) (g w)
--pointIsClose p = dist camCen p < _viewDistance w
pointIsClose = cullPoint w
--camCen = _cameraCenter w
pointIsClose = cullPoint cfig w
cullPoint :: World -> Point2 -> Bool
cullPoint w p = pointInPolygon p (_boundBox w)
cullPoint :: Configuration -> World -> Point2 -> Bool
cullPoint cfig w p
| debugOn Close_shape_culling cfig = pointInPolygon p (_boundBox w)
| otherwise = dist (_cameraCenter w) p < _viewDistance w
extraShapes :: World -> Shape
extraShapes = _foregroundShape
@@ -69,9 +69,15 @@ extraPics cfig w = pictures (_decorations w)
<> drawWallIDs cfig w
<> drawPathing cfig w
<> drawCrInfo cfig w
<> drawBoundingBox cfig w
testPic :: Configuration -> World -> Picture
testPic cfig w = setLayer DebugLayer $ color green $ line $ (x:xs) ++ [x]
testPic _ _ = mempty
drawBoundingBox :: Configuration -> World -> Picture
drawBoundingBox cfig w
| debugOn Show_bound_box cfig = setLayer DebugLayer $ color green $ line $ (x:xs) ++ [x]
| otherwise = mempty
where
(x:xs) = cullBox cfig w